move from asciidoc html to asciidoc -> docbook -> html

As best as I can tell this is the easiest way to customize
the asciidoc HTML output.
This commit is contained in:
Evan Martin 2013-02-16 17:13:10 -08:00
parent 370249f528
commit d3c4cf1b36
3 changed files with 54 additions and 3 deletions

View File

@ -397,9 +397,14 @@ n.newline()
n.comment('Generate the manual using asciidoc.') n.comment('Generate the manual using asciidoc.')
n.rule('asciidoc', n.rule('asciidoc',
command='asciidoc -a toc -a max-width=45em -o $out $in', command='asciidoc -b docbook -d book -o $out $in',
description='ASCIIDOC $in') description='ASCIIDOC $out')
manual = n.build(doc('manual.html'), 'asciidoc', doc('manual.asciidoc')) 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', n.build('manual', 'phony',
order_only=manual) order_only=manual)
n.newline() n.newline()

17
doc/docbook.xsl Normal file
View File

@ -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>

29
doc/style.css Normal file
View File

@ -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;
}