hgbook
changeset 624:3c5e1c03cc3e
Add XSL stylesheets for DocBook
author | Dongsheng Song <dongsheng.song@gmail.com> |
---|---|
date | Thu Mar 12 15:47:15 2009 +0800 (2009-03-12) |
parents | 082bb76417f1 |
children | cfdb601a3c8b |
files | xsl/en/fo.xsl xsl/en/html-single.xsl xsl/en/html.xsl xsl/fo.xsl xsl/html-single.xsl xsl/html.xsl xsl/zh/fo.xsl xsl/zh/html-single.xsl xsl/zh/html.xsl |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xsl/en/fo.xsl Thu Mar 12 15:47:15 2009 +0800 1.3 @@ -0,0 +1,10 @@ 1.4 +<?xml version="1.0"?> 1.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 1.6 + xmlns:fo="http://www.w3.org/1999/XSL/Format" 1.7 + version='1.0'> 1.8 + 1.9 + <xsl:import href="../fo.xsl"/> 1.10 + 1.11 + <xsl:param name="l10n.gentext.language" select="'en'"/> 1.12 + 1.13 +</xsl:stylesheet>
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/xsl/en/html-single.xsl Thu Mar 12 15:47:15 2009 +0800 2.3 @@ -0,0 +1,8 @@ 2.4 +<?xml version="1.0"?> 2.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> 2.6 + 2.7 + <xsl:import href="../html-single.xsl"/> 2.8 + 2.9 + <xsl:param name="l10n.gentext.language" select="'en'"/> 2.10 + 2.11 +</xsl:stylesheet>
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/xsl/en/html.xsl Thu Mar 12 15:47:15 2009 +0800 3.3 @@ -0,0 +1,8 @@ 3.4 +<?xml version="1.0"?> 3.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> 3.6 + 3.7 + <xsl:import href="../html.xsl"/> 3.8 + 3.9 + <xsl:param name="l10n.gentext.language" select="'en'"/> 3.10 + 3.11 +</xsl:stylesheet>
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/xsl/fo.xsl Thu Mar 12 15:47:15 2009 +0800 4.3 @@ -0,0 +1,79 @@ 4.4 +<?xml version="1.0"?> 4.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> 4.6 + 4.7 + <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/> 4.8 + 4.9 + <xsl:param name="draft.mode" select="no"/> 4.10 + 4.11 + <!-- These extensions are required for table printing and other stuff --> 4.12 + <xsl:param name="use.extensions">1</xsl:param> 4.13 + <xsl:param name="callouts.extension">1</xsl:param> 4.14 + <xsl:param name="linenumbering.extension">1</xsl:param> 4.15 + <xsl:param name="tablecolumns.extension">1</xsl:param> 4.16 + <xsl:param name="textinsert.extension">1</xsl:param> 4.17 + 4.18 + <xsl:param name="admon.graphics" select="1" /> 4.19 + <xsl:param name="admon.graphics.extension">.png</xsl:param> 4.20 + <xsl:param name="callout.graphics" select="1" /> 4.21 + <xsl:param name="callout.graphics.extension">.png</xsl:param> 4.22 + 4.23 + <xsl:param name="section.autolabel" select="1" /> 4.24 + <xsl:param name="section.label.includes.component.label">1</xsl:param> 4.25 + 4.26 + <xsl:param name="variablelist.as.blocks" select="1" /> <!-- fo only --> 4.27 + <xsl:param name="hyphenate">false</xsl:param> <!-- fo only --> 4.28 + <xsl:param name="paper.type" select="'A4'"></xsl:param> <!-- fo only --> 4.29 + 4.30 + <!-- Default font settings --> 4.31 + <!-- 4.32 + <xsl:param name="title.font.family">sans-serif</xsl:param> 4.33 + <xsl:param name="body.font.family">serif</xsl:param> 4.34 + <xsl:param name="sans.font.family">sans-serif</xsl:param> 4.35 + <xsl:param name="dingbat.font.family">serif</xsl:param> 4.36 + <xsl:param name="monospace.font.family">monospace</xsl:param> 4.37 + <xsl:param name="symbol.font.family">Symbol,ZapfDingbats</xsl:param> 4.38 + --> 4.39 + 4.40 + <!-- Custom font settings - preferred truetype font --> 4.41 + <xsl:param name="title.font.family">Calibri,sans-serif,SimHei</xsl:param> 4.42 + <xsl:param name="body.font.family">Cambria,Cambria Math,serif,SimSun</xsl:param> 4.43 + <xsl:param name="sans.font.family">Calibri,sans-serif,SimHei</xsl:param> 4.44 + <xsl:param name="dingbat.font.family">Cambria,Cambria Math,serif,SimSun</xsl:param> 4.45 + <xsl:param name="monospace.font.family">Courier New,monospace,FangSong</xsl:param> 4.46 + 4.47 + <!-- Page related Settings --> 4.48 + <xsl:param name="page.margin.inner">1.5cm</xsl:param> 4.49 + <xsl:param name="page.margin.outer">1.5cm</xsl:param> 4.50 + <xsl:param name="title.margin.left">0pt</xsl:param> 4.51 + <xsl:param name="body.start.indent">24pt</xsl:param> 4.52 + <xsl:param name="body.end.indent">0pt</xsl:param> 4.53 + 4.54 + <!-- Breaking long lines --> 4.55 + <xsl:param name="hyphenate.verbatim">1</xsl:param> 4.56 + <xsl:attribute-set name="monospace.verbatim.properties" 4.57 + use-attribute-sets="verbatim.properties monospace.properties"> 4.58 + <xsl:attribute name="wrap-option">wrap</xsl:attribute> 4.59 + <xsl:attribute name="hyphenation-character">►</xsl:attribute> 4.60 + </xsl:attribute-set> 4.61 + 4.62 + <!-- Prevent blank pages in output --> 4.63 + <xsl:template name="book.titlepage.before.verso"> 4.64 + </xsl:template> 4.65 + <xsl:template name="book.titlepage.verso"> 4.66 + </xsl:template> 4.67 + <xsl:template name="book.titlepage.separator"> 4.68 + </xsl:template> 4.69 + 4.70 + <!-- Colourize links in output --> 4.71 + <xsl:attribute-set name="xref.properties"> 4.72 + <xsl:attribute name="color"> 4.73 + <xsl:choose> 4.74 + <xsl:when test="self::ulink">blue</xsl:when> 4.75 + <xsl:when test="self::xref">blue</xsl:when> 4.76 + <xsl:when test="self::uri">blue</xsl:when> 4.77 + <xsl:otherwise>red</xsl:otherwise> 4.78 + </xsl:choose> 4.79 + </xsl:attribute> 4.80 + </xsl:attribute-set> 4.81 + 4.82 +</xsl:stylesheet>
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/xsl/html-single.xsl Thu Mar 12 15:47:15 2009 +0800 5.3 @@ -0,0 +1,30 @@ 5.4 +<?xml version="1.0"?> 5.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> 5.6 + 5.7 + <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/> 5.8 + 5.9 + <xsl:param name="draft.mode" select="no"/> 5.10 + 5.11 + <!-- xsltproc can't support these extensions 5.12 + <xsl:param name="use.extensions">1</xsl:param> 5.13 + <xsl:param name="callouts.extension">1</xsl:param> 5.14 + <xsl:param name="linenumbering.extension">1</xsl:param> 5.15 + <xsl:param name="tablecolumns.extension">1</xsl:param> 5.16 + <xsl:param name="textinsert.extension">1</xsl:param> 5.17 + --> 5.18 + 5.19 + <xsl:param name="admon.graphics" select="1" /> 5.20 + <xsl:param name="admon.graphics.extension">.png</xsl:param> 5.21 + <xsl:param name="callout.graphics" select="1" /> 5.22 + <xsl:param name="callout.graphics.extension">.png</xsl:param> 5.23 + 5.24 + <xsl:param name="section.autolabel" select="1" /> 5.25 + <xsl:param name="section.label.includes.component.label">1</xsl:param> 5.26 + 5.27 + <xsl:output method="html" encoding="utf-8" indent="yes"/> <!-- html only --> 5.28 + <xsl:param name="use.id.as.filename">0</xsl:param> <!-- html only --> 5.29 + <xsl:param name="chunk.section.depth">0</xsl:param> <!-- html only --> 5.30 + <xsl:param name="chunker.output.indent">yes</xsl:param> <!-- html only --> 5.31 + <xsl:param name="html.stylesheet">hgbook.css</xsl:param> <!-- html only --> 5.32 + 5.33 +</xsl:stylesheet>
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6.2 +++ b/xsl/html.xsl Thu Mar 12 15:47:15 2009 +0800 6.3 @@ -0,0 +1,30 @@ 6.4 +<?xml version="1.0"?> 6.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> 6.6 + 6.7 + <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/> 6.8 + 6.9 + <xsl:param name="draft.mode" select="no"/> 6.10 + 6.11 + <!-- xsltproc can't support these extensions 6.12 + <xsl:param name="use.extensions">1</xsl:param> 6.13 + <xsl:param name="callouts.extension">1</xsl:param> 6.14 + <xsl:param name="linenumbering.extension">1</xsl:param> 6.15 + <xsl:param name="tablecolumns.extension">1</xsl:param> 6.16 + <xsl:param name="textinsert.extension">1</xsl:param> 6.17 + --> 6.18 + 6.19 + <xsl:param name="admon.graphics" select="1" /> 6.20 + <xsl:param name="admon.graphics.extension">.png</xsl:param> 6.21 + <xsl:param name="callout.graphics" select="1" /> 6.22 + <xsl:param name="callout.graphics.extension">.png</xsl:param> 6.23 + 6.24 + <xsl:param name="section.autolabel" select="1" /> 6.25 + <xsl:param name="section.label.includes.component.label">1</xsl:param> 6.26 + 6.27 + <xsl:output method="html" encoding="utf-8" indent="yes"/> <!-- html only --> 6.28 + <xsl:param name="use.id.as.filename">0</xsl:param> <!-- html only --> 6.29 + <xsl:param name="chunk.section.depth">0</xsl:param> <!-- html only --> 6.30 + <xsl:param name="chunker.output.indent">yes</xsl:param> <!-- html only --> 6.31 + <xsl:param name="html.stylesheet">hgbook.css</xsl:param> <!-- html only --> 6.32 + 6.33 +</xsl:stylesheet>
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7.2 +++ b/xsl/zh/fo.xsl Thu Mar 12 15:47:15 2009 +0800 7.3 @@ -0,0 +1,30 @@ 7.4 +<?xml version="1.0"?> 7.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 7.6 + xmlns:fo="http://www.w3.org/1999/XSL/Format" 7.7 + version='1.0'> 7.8 + 7.9 + <xsl:import href="../fo.xsl"/> 7.10 + 7.11 + <xsl:param name="l10n.gentext.language" select="'zh'"/> 7.12 + 7.13 + <!-- Chinese font related settings --> 7.14 + <xsl:param name="body.font.master">12</xsl:param> 7.15 + 7.16 + <xsl:attribute-set name="standard.para.spacing" use-attribute-sets="normal.para.spacing"> 7.17 + <xsl:attribute name="text-indent">24pt</xsl:attribute> 7.18 + </xsl:attribute-set> 7.19 + 7.20 + <xsl:template match="abstract/para|appendix/para|chapter/para|colophon/para|legalnotice/para|preface/para|section/para|sect1/para|sect2/para"> 7.21 + <fo:block xsl:use-attribute-sets="standard.para.spacing"> 7.22 + <xsl:call-template name="anchor"/> 7.23 + <xsl:apply-templates/> 7.24 + </fo:block> 7.25 + </xsl:template> 7.26 + 7.27 + <xsl:template match="section/para/*"> 7.28 + <fo:wrapper text-indent="0pt"> 7.29 + <xsl:apply-imports/> 7.30 + </fo:wrapper> 7.31 + </xsl:template> 7.32 + 7.33 +</xsl:stylesheet>
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 8.2 +++ b/xsl/zh/html-single.xsl Thu Mar 12 15:47:15 2009 +0800 8.3 @@ -0,0 +1,8 @@ 8.4 +<?xml version="1.0"?> 8.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> 8.6 + 8.7 + <xsl:import href="../html-single.xsl"/> 8.8 + 8.9 + <xsl:param name="l10n.gentext.language" select="'zh'"/> 8.10 + 8.11 +</xsl:stylesheet>
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 9.2 +++ b/xsl/zh/html.xsl Thu Mar 12 15:47:15 2009 +0800 9.3 @@ -0,0 +1,8 @@ 9.4 +<?xml version="1.0"?> 9.5 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> 9.6 + 9.7 + <xsl:import href="../html.xsl"/> 9.8 + 9.9 + <xsl:param name="l10n.gentext.language" select="'zh'"/> 9.10 + 9.11 +</xsl:stylesheet>