diff --git a/Makefile b/Makefile
index 9e259e1..34a9dd3 100644
--- a/Makefile
+++ b/Makefile
@@ -65,6 +65,9 @@ unittests=$(wildcard test_*.py)
unittest: *.py
python2.7 -m unittest $(unittests:.py=)
+xmllinthtmlbook: examples/htmlbook.html
+ xmllint --noout --schema ../HTMLBook/schema/htmlbook.xsd examples/htmlbook.html
+
upload: html png pdf rtf
if [ -n "$(uploadto)" ]; then \
scp examples/*.html examples/*.png examples/*.pdf examples/*.rtf \
@@ -88,7 +91,7 @@ fixmes:
grep FIXME *.py
.PHONY: all clean fixmes uploadto expected checkexpected test unittest \
- templatejstest
+ templatejstest xmllinthtmlbook
.PRECIOUS: %.tex %.dot
diff --git a/examples/htmlbook.gamebook b/examples/htmlbook.gamebook
new file mode 100644
index 0000000..8b0b966
--- /dev/null
+++ b/examples/htmlbook.gamebook
@@ -0,0 +1,19 @@
+title = HTMLBook
+= Introduction
+This is an introduction.
+This example gamebook is for testing the htmlbook option.
+See https://github.com/oreillymedia/HTMLBook for more information about HTMLBook.
+
+= More
+This is another introduction section, just to see that formatting is correct when
+there are more than one.
+
+* start
+This is the first section. From here you can go to the unnamed section [[second]]
+or [[third][this named section]].
+
+* second
+Got to another section. Story ends here.
+
+* third
+Got to this section. Story ends here.
diff --git a/examples/htmlbook.gamebook.options b/examples/htmlbook.gamebook.options
new file mode 100644
index 0000000..1203b44
--- /dev/null
+++ b/examples/htmlbook.gamebook.options
@@ -0,0 +1 @@
+--option htmlbook
\ No newline at end of file
diff --git a/options/htmlbook/html/add.html b/options/htmlbook/html/add.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/add.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/atleast.html b/options/htmlbook/html/atleast.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/atleast.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/auto.html b/options/htmlbook/html/auto.html
new file mode 100644
index 0000000..e69de29
diff --git a/options/htmlbook/html/begin.html b/options/htmlbook/html/begin.html
new file mode 100644
index 0000000..2587961
--- /dev/null
+++ b/options/htmlbook/html/begin.html
@@ -0,0 +1,17 @@
+
+
+
+
+
+ %(title)s
+
+
+
+
+
%(title)s
+
%(author)s
+
+
+
%(title)s
diff --git a/options/htmlbook/html/collect.html b/options/htmlbook/html/collect.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/collect.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/collections.html b/options/htmlbook/html/collections.html
new file mode 100644
index 0000000..e69de29
diff --git a/options/htmlbook/html/collectiontemplate.html b/options/htmlbook/html/collectiontemplate.html
new file mode 100644
index 0000000..e69de29
diff --git a/options/htmlbook/html/cost.html b/options/htmlbook/html/cost.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/cost.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/count.html b/options/htmlbook/html/count.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/count.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/counters.html b/options/htmlbook/html/counters.html
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/options/htmlbook/html/counters.html
@@ -0,0 +1 @@
+
diff --git a/options/htmlbook/html/countertemplate.html b/options/htmlbook/html/countertemplate.html
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/options/htmlbook/html/countertemplate.html
@@ -0,0 +1 @@
+
diff --git a/options/htmlbook/html/dec.html b/options/htmlbook/html/dec.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/dec.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/drop.html b/options/htmlbook/html/drop.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/drop.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/end.html b/options/htmlbook/html/end.html
new file mode 100644
index 0000000..e887555
--- /dev/null
+++ b/options/htmlbook/html/end.html
@@ -0,0 +1,3 @@
+
+
+
diff --git a/options/htmlbook/html/endscript.html b/options/htmlbook/html/endscript.html
new file mode 100644
index 0000000..e69de29
diff --git a/options/htmlbook/html/found.html b/options/htmlbook/html/found.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/found.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/has.html b/options/htmlbook/html/has.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/has.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/hasnot.html b/options/htmlbook/html/hasnot.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/hasnot.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/hideintro.html b/options/htmlbook/html/hideintro.html
new file mode 100644
index 0000000..e69de29
diff --git a/options/htmlbook/html/img.html b/options/htmlbook/html/img.html
new file mode 100644
index 0000000..6d446ff
--- /dev/null
+++ b/options/htmlbook/html/img.html
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/options/htmlbook/html/inc.html b/options/htmlbook/html/inc.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/inc.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/init.html b/options/htmlbook/html/init.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/init.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/introsection.html b/options/htmlbook/html/introsection.html
new file mode 100644
index 0000000..c036eb1
--- /dev/null
+++ b/options/htmlbook/html/introsection.html
@@ -0,0 +1,5 @@
+
+
%(name)s
+
%(text)s
+
+
diff --git a/options/htmlbook/html/lessthan.html b/options/htmlbook/html/lessthan.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/lessthan.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/min.html b/options/htmlbook/html/min.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/min.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/morethan.html b/options/htmlbook/html/morethan.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/morethan.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/named_section_ref.html b/options/htmlbook/html/named_section_ref.html
new file mode 100644
index 0000000..ce98952
--- /dev/null
+++ b/options/htmlbook/html/named_section_ref.html
@@ -0,0 +1 @@
+%(name)s
diff --git a/options/htmlbook/html/random.html b/options/htmlbook/html/random.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/random.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/script.html b/options/htmlbook/html/script.html
new file mode 100644
index 0000000..e69de29
diff --git a/options/htmlbook/html/section.html b/options/htmlbook/html/section.html
new file mode 100644
index 0000000..cf4a9b5
--- /dev/null
+++ b/options/htmlbook/html/section.html
@@ -0,0 +1,4 @@
+
+
%(nr)d
+
%(text)s
+
diff --git a/options/htmlbook/html/section_ref.html b/options/htmlbook/html/section_ref.html
new file mode 100644
index 0000000..b597d68
--- /dev/null
+++ b/options/htmlbook/html/section_ref.html
@@ -0,0 +1 @@
+%(nr)d
diff --git a/options/htmlbook/html/sections_begin.html b/options/htmlbook/html/sections_begin.html
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/options/htmlbook/html/sections_begin.html
@@ -0,0 +1 @@
+
diff --git a/options/htmlbook/html/set.html b/options/htmlbook/html/set.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/set.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/showintro.html b/options/htmlbook/html/showintro.html
new file mode 100644
index 0000000..e69de29
diff --git a/options/htmlbook/html/take.html b/options/htmlbook/html/take.html
new file mode 100644
index 0000000..942641b
--- /dev/null
+++ b/options/htmlbook/html/take.html
@@ -0,0 +1 @@
+%(inner)s
diff --git a/options/htmlbook/html/viewport.html b/options/htmlbook/html/viewport.html
new file mode 100644
index 0000000..e69de29
diff --git a/options/htmlbook/html/xor.html b/options/htmlbook/html/xor.html
new file mode 100644
index 0000000..e69de29