Generate the book in XHTML instead of HTML
Øyvind A. Holm
sunny at sunbase.org
Mon Mar 7 19:24:26 CST 2005
Marcus Rueckert (darix) came with a solution on irc which makes xsltproc
generate XHTML instead of HTML. This generates UTF-8 output instead of
ISO-8859-1, which is a Good Thing in the long term when books in
non-Western languages will be built. The HTML which is generated now
also lacks a proper DOCTYPE declaration, which the XHTML version has. In
addition, the XHTML version has proper indents in the header which makes
it way more readable. The size doesn't increase much, less than 6k in
the Norwegian single-page XHTML file. I have tested the patch with make
all, and XHTML, PostScript and PDF generation works fine.
[[[
Change the xsl stylesheets in tools/ so xsltproc generates XHTML instead
of HTML. Default character set is now UTF-8 instead of ISO-8859-1 and
the XHTML is properly indented and contains a DOCTYPE declaration, which
the previous HTML version lacked.
* src/tools/html-stylesheet.xsl
Change <xsl:import href> to "xsl/xhtml/docbook.xsl".
* src/tools/chunk-stylesheet.xsl
Change <xsl:import href> to "xsl/xhtml/chunk.xsl".
Add <xsl:param name="chunker.output.indent">yes</xsl:param> .
Patch by Marcus Rueckert <darix at irssi.org>.
]]]
Index: src/tools/html-stylesheet.xsl
===================================================================
--- src/tools/html-stylesheet.xsl (revision 1156)
+++ src/tools/html-stylesheet.xsl (working copy)
@@ -1,6 +1,6 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
- <xsl:import href="xsl/html/docbook.xsl"/>
+ <xsl:import href="xsl/xhtml/docbook.xsl"/>
<xsl:param name="html.stylesheet">styles.css</xsl:param>
<xsl:param name="toc.section.depth">3</xsl:param>
Index: src/tools/chunk-stylesheet.xsl
===================================================================
--- src/tools/chunk-stylesheet.xsl (revision 1156)
+++ src/tools/chunk-stylesheet.xsl (working copy)
@@ -1,10 +1,11 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
- <xsl:import href="xsl/html/chunk.xsl"/>
+ <xsl:import href="xsl/xhtml/chunk.xsl"/>
<xsl:param name="html.stylesheet">styles.css</xsl:param>
<xsl:param name="toc.section.depth">3</xsl:param>
<xsl:param name="annotate.toc">0</xsl:param>
+ <xsl:param name="chunker.output.indent">yes</xsl:param>
<xsl:template match="sect1" mode="toc">
<xsl:param name="toc-context" select="."/>
-- sunny256
More information about the svnbook-dev
mailing list