summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure.py11
-rw-r--r--doc/docbook.xsl17
-rw-r--r--doc/style.css29
3 files changed, 54 insertions, 3 deletions
diff --git a/configure.py b/configure.py
index dc6bfb9..10c6994 100755
--- a/configure.py
+++ b/configure.py
@@ -397,9 +397,14 @@ n.newline()
n.comment('Generate the manual using asciidoc.')
n.rule('asciidoc',
- command='asciidoc -a toc -a max-width=45em -o $out $in',
- description='ASCIIDOC $in')
-manual = n.build(doc('manual.html'), 'asciidoc', doc('manual.asciidoc'))
+ command='asciidoc -b docbook -d book -o $out $in',
+ description='ASCIIDOC $out')
+n.rule('xsltproc',
+ command='xsltproc --nonet doc/docbook.xsl $in > $out',
+ description='XSLTPROC $out')
+xml = n.build(built('manual.xml'), 'asciidoc', doc('manual.asciidoc'))
+manual = n.build(doc('manual.html'), 'xsltproc', xml,
+ implicit=doc('style.css'))
n.build('manual', 'phony',
order_only=manual)
n.newline()
diff --git a/doc/docbook.xsl b/doc/docbook.xsl
new file mode 100644
index 0000000..8afdc8c
--- /dev/null
+++ b/doc/docbook.xsl
@@ -0,0 +1,17 @@
+<!-- This soup of XML is the minimum customization necessary to make the
+ autogenerated manual look ok. -->
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY css SYSTEM "style.css">
+]>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version='1.0'>
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
+ <xsl:template name="user.head.content"><style>&css;</style></xsl:template>
+ <xsl:template name="body.attributes"></xsl:template>
+ <xsl:param name="generate.toc" select="'book toc'"/>
+ <xsl:param name="chapter.autolabel" select="0" />
+ <xsl:param name="toc.list.type">ul</xsl:param>
+
+ <xsl:output method="html" encoding="utf-8" indent="no"
+ doctype-public=""/>
+</xsl:stylesheet>
diff --git a/doc/style.css b/doc/style.css
new file mode 100644
index 0000000..fc22ec1
--- /dev/null
+++ b/doc/style.css
@@ -0,0 +1,29 @@
+body {
+ margin: 5ex 10ex;
+ max-width: 40em;
+ line-height: 1.4;
+ font-family: sans-serif;
+ font-size: 0.8em;
+}
+h1, h2, h3 {
+ font-weight: normal;
+}
+pre, code {
+ font-family: x, monospace;
+}
+pre {
+ padding: 1ex;
+ background: #eee;
+ border: solid 1px #ddd;
+ min-width: 0;
+ font-size: 90%;
+}
+code {
+ color: #007;
+}
+.chapter {
+ margin-top: 4em;
+}
+p {
+ margin-top: 0;
+}