diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-03-28 20:22:32 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-03-28 20:22:32 (GMT) |
commit | 335d3d25e07ddcf7c00ba3b2550858a2374dd3db (patch) | |
tree | 26a5d95818e3e12ac2811903fe815044fa7f6d73 /BuildTools/DocBook/Stylesheets | |
parent | 3afa4f741c26360245dc313bc368f508b26a6b96 (diff) | |
download | swift-contrib-335d3d25e07ddcf7c00ba3b2550858a2374dd3db.zip swift-contrib-335d3d25e07ddcf7c00ba3b2550858a2374dd3db.tar.bz2 |
Moved DocBook module.
Diffstat (limited to 'BuildTools/DocBook/Stylesheets')
-rw-r--r-- | BuildTools/DocBook/Stylesheets/common/inline.xsl | 27 | ||||
-rw-r--r-- | BuildTools/DocBook/Stylesheets/common/params.xsl | 8 | ||||
-rw-r--r-- | BuildTools/DocBook/Stylesheets/fo/component.xsl | 29 | ||||
-rw-r--r-- | BuildTools/DocBook/Stylesheets/fo/docbook.test.xsl | 151 | ||||
-rw-r--r-- | BuildTools/DocBook/Stylesheets/fo/docbook.xsl | 151 | ||||
-rw-r--r-- | BuildTools/DocBook/Stylesheets/fo/inline.xsl | 17 | ||||
-rw-r--r-- | BuildTools/DocBook/Stylesheets/fo/titlepage.xsl | 6 | ||||
-rw-r--r-- | BuildTools/DocBook/Stylesheets/html/docbook.xsl | 34 |
8 files changed, 423 insertions, 0 deletions
diff --git a/BuildTools/DocBook/Stylesheets/common/inline.xsl b/BuildTools/DocBook/Stylesheets/common/inline.xsl new file mode 100644 index 0000000..5f39338 --- /dev/null +++ b/BuildTools/DocBook/Stylesheets/common/inline.xsl @@ -0,0 +1,27 @@ +<?xml version='1.0'?> +<xsl:stylesheet + xmlns:fo="http://www.w3.org/1999/XSL/Format" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:template match="application"> + <fo:inline font-style="italic"><xsl:call-template name="inline.charseq"/></fo:inline> + </xsl:template> + + <xsl:template match="guimenu"> + <fo:inline font-style="italic"><xsl:call-template name="inline.charseq"/></fo:inline> + </xsl:template> + + <xsl:template match="guilabel"> + <fo:inline font-style="italic"><xsl:call-template name="inline.charseq"/></fo:inline> + </xsl:template> + + <xsl:template match="guimenuitem"> + <fo:inline font-style="italic"><xsl:call-template name="inline.charseq"/></fo:inline> + </xsl:template> + + <xsl:template match="guisubmenu"> + <fo:inline font-style="italic"><xsl:call-template name="inline.charseq"/></fo:inline> + </xsl:template> + +</xsl:stylesheet> diff --git a/BuildTools/DocBook/Stylesheets/common/params.xsl b/BuildTools/DocBook/Stylesheets/common/params.xsl new file mode 100644 index 0000000..6da03c0 --- /dev/null +++ b/BuildTools/DocBook/Stylesheets/common/params.xsl @@ -0,0 +1,8 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + <xsl:param name="xref.with.number.and.title" select="'0'"/> + <xsl:param name="callout.graphics" select="'0'"/> + <xsl:param name="callout.unicode" select="'1'"/> + +</xsl:stylesheet> diff --git a/BuildTools/DocBook/Stylesheets/fo/component.xsl b/BuildTools/DocBook/Stylesheets/fo/component.xsl new file mode 100644 index 0000000..829695d --- /dev/null +++ b/BuildTools/DocBook/Stylesheets/fo/component.xsl @@ -0,0 +1,29 @@ +<?xml version='1.0'?> +<xsl:stylesheet + xmlns:fo="http://www.w3.org/1999/XSL/Format" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + +<xsl:template match="colophon"> + <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="colophon.titlepage.recto.style" margin-left="{$title.margin.left}" font-size="24.8832pt" font-family="{$title.fontset}" font-weight="bold"> + <xsl:call-template name="colophon.titlepage"/> + </fo:block> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template name="colophon.titlepage.recto"> + <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="colophon.titlepage.recto.style" margin-left="{$title.margin.left}" font-size="24.8832pt" font-family="{$title.fontset}" font-weight="bold"> +<xsl:call-template name="component.colophon.title"> +<xsl:with-param name="node" select="ancestor-or-self::colophon[1]"/> +</xsl:call-template></fo:block> +</xsl:template> + +<xsl:template name="component.colophon.title"> + <fo:block xsl:use-attribute-sets="component.title.properties" text-align="left"> + <xsl:apply-templates select="." mode="object.title.markup"> + <xsl:with-param name="allow-anchors" select="1"/> + </xsl:apply-templates> + </fo:block> +</xsl:template> + +</xsl:stylesheet> diff --git a/BuildTools/DocBook/Stylesheets/fo/docbook.test.xsl b/BuildTools/DocBook/Stylesheets/fo/docbook.test.xsl new file mode 100644 index 0000000..c6d6106 --- /dev/null +++ b/BuildTools/DocBook/Stylesheets/fo/docbook.test.xsl @@ -0,0 +1,151 @@ +<?xml version='1.0'?> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" + version="1.0"> + + <!-- Include other stylesheets --> + <xsl:import href="../../../docbook/xsl/fo/docbook.xsl"/> + <xsl:include href="../common/params.xsl" /> + <xsl:include href="../common/inline.xsl" /> + <xsl:include href="component.xsl" /> + <xsl:include href="inline.xsl" /> + <xsl:include href="titlepage.xsl"/> + + <xsl:param name="section.autolabel" select="'0'"/> + + <!-- Images --> + <xsl:param name="draft.watermark.image" select="''"/> + + <!-- Enable bookmarks --> + <xsl:param name="fop1.extensions" select="1"/> + + <!-- Do not print out URLs --> + <xsl:param name="ulink.show" select="0"/> + <!--<xsl:param name="show.comments" select="0"/>--> + + <!-- Page setup --> + <xsl:param name="paper.type" select="'A4'"/> + <!--<xsl:param name="double.sided"/>--> + + <!--<xsl:param name="header.column.widths">0 1 0</xsl:param>--> + <!--<xsl:attribute-set name="header.content.properties"> + <xsl:attribute name="font-family">Helvetica</xsl:attribute> + <xsl:attribute name="font-size">12pt</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + </xsl:attribute-set>--> + + <!--<xsl:attribute-set name="footer.content.properties"> + <xsl:attribute name="font-family">Helvetica</xsl:attribute> + <xsl:attribute name="font-size">8pt</xsl:attribute> + </xsl:attribute-set> + <xsl:param name="footer.rule" select="0"/>--> + + <xsl:param name="page.margin.top" select="'3.9cm'"/> + <xsl:param name="page.margin.bottom" select="'3.9cm'"/> + <xsl:param name="page.margin.inner" select="'4cm'"/> + <xsl:param name="page.margin.outer" select="'4cm'"/> + <xsl:param name="body.start.indent" select="'0'"/> + <xsl:param name="body.margin.bottom" select="'1.2cm'"/> + <xsl:attribute-set name="normal.para.spacing"> + <xsl:attribute name="space-before.optimum">0.4em</xsl:attribute> + <xsl:attribute name="space-before.minimum">0.3em</xsl:attribute> + <xsl:attribute name="space-before.maximum">0.5em</xsl:attribute> + </xsl:attribute-set> + <xsl:attribute-set name="list.block.spacing"> + <xsl:attribute name="space-before.optimum">0.4em</xsl:attribute> + <xsl:attribute name="space-before.minimum">0.3em</xsl:attribute> + <xsl:attribute name="space-before.maximum">0.5em</xsl:attribute> + <xsl:attribute name="space-after.optimum">0.4em</xsl:attribute> + <xsl:attribute name="space-after.minimum">0.3em</xsl:attribute> + <xsl:attribute name="space-after.maximum">0.5em</xsl:attribute> + </xsl:attribute-set> + <xsl:attribute-set name="list.item.spacing"> + <xsl:attribute name="space-before.optimum">0.4em</xsl:attribute> + <xsl:attribute name="space-before.minimum">0.3em</xsl:attribute> + <xsl:attribute name="space-before.maximum">0.5em</xsl:attribute> + </xsl:attribute-set> + <xsl:attribute-set name="verbatim.properties"> + <xsl:attribute name="space-before.minimum">0.3em</xsl:attribute> + <xsl:attribute name="space-before.optimum">0.4em</xsl:attribute> + <xsl:attribute name="space-before.maximum">0.5em</xsl:attribute> + <xsl:attribute name="space-after.minimum">0.3em</xsl:attribute> + <xsl:attribute name="space-after.optimum">0.4em</xsl:attribute> + <xsl:attribute name="space-after.maximum">0.5em</xsl:attribute> + <xsl:attribute name="hyphenate">false</xsl:attribute> + <xsl:attribute name="wrap-option">no-wrap</xsl:attribute> + <xsl:attribute name="white-space-collapse">false</xsl:attribute> + <xsl:attribute name="white-space-treatment">preserve</xsl:attribute> + <xsl:attribute name="linefeed-treatment">preserve</xsl:attribute> + <xsl:attribute name="text-align">start</xsl:attribute> + <xsl:attribute name="start-indent">10pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:param name="variablelist.as.blocks" select="0"/> + + <!-- Fonts & colors --> + <xsl:param name="body.font.master" select="10"/> + <xsl:param name="body.font.family" select="'Fontin Sans'"/> + <xsl:param name="title.font.family" select="'Fontin Sans'"/> + <xsl:param name="monospace.font.family" select="'Inconsolata,Courier'"/> + + <xsl:attribute-set name="monospace.verbatim.properties"> + <xsl:attribute name="font-size">.8em</xsl:attribute> + <xsl:attribute name="padding">5pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="nongraphical.admonition.properties"> + <xsl:attribute name="background-color">#F0F0F0</xsl:attribute> + <xsl:attribute name="padding">5pt</xsl:attribute> + </xsl:attribute-set> + + <!--<xsl:param name="shade.verbatim" select="1"/> + <xsl:attribute-set name="shade.verbatim.style"> + <xsl:attribute name="border">0</xsl:attribute> + <xsl:attribute name="background-color">#F0F0F0</xsl:attribute> + </xsl:attribute-set> --> + + <xsl:attribute-set name="section.title.chapter.properties"> + <xsl:attribute name="font-size"> + <xsl:value-of select="$body.font.master * 1.8"/> + <xsl:text>pt</xsl:text> + </xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="section.title.level1.properties"> + <xsl:attribute name="font-size"> + <xsl:value-of select="$body.font.master * 1.7"/> + <xsl:text>pt</xsl:text> + </xsl:attribute> + <!--<xsl:attribute name="border-bottom">1pt solid #505050</xsl:attribute>--> + </xsl:attribute-set> + + <xsl:attribute-set name="section.title.level2.properties"> + <xsl:attribute name="font-size"> + <xsl:value-of select="$body.font.master * 1.4"/> + <xsl:text>pt</xsl:text> + </xsl:attribute> + </xsl:attribute-set> + + <!-- FIXME: Doesn't work + <xsl:attribute-set name="bibliography.title.properties"> + <xsl:attribute name="break-before">page</xsl:attribute> + </xsl:attribute-set> + --> + + <xsl:attribute-set name="toc.line.properties"> + <xsl:attribute name="font-size">10pt</xsl:attribute> + <xsl:attribute name="font-weight"> + <xsl:choose> + <xsl:when test="self::chapter | self::preface | self::appendix">bold</xsl:when> + <xsl:otherwise>normal</xsl:otherwise> + </xsl:choose> + </xsl:attribute> + </xsl:attribute-set> + + <xsl:param name="generate.toc"> + book toc,title + </xsl:param> + +</xsl:stylesheet> + diff --git a/BuildTools/DocBook/Stylesheets/fo/docbook.xsl b/BuildTools/DocBook/Stylesheets/fo/docbook.xsl new file mode 100644 index 0000000..1a27317 --- /dev/null +++ b/BuildTools/DocBook/Stylesheets/fo/docbook.xsl @@ -0,0 +1,151 @@ +<?xml version='1.0'?> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" + version="1.0"> + + <!-- Include other stylesheets --> + <xsl:import href="docbook-xsl:/fo/docbook.xsl"/> + <xsl:include href="../common/params.xsl" /> + <xsl:include href="../common/inline.xsl" /> + <xsl:include href="component.xsl" /> + <xsl:include href="inline.xsl" /> + <xsl:include href="titlepage.xsl"/> + + <xsl:param name="section.autolabel" select="'0'"/> + + <!-- Images --> + <xsl:param name="draft.watermark.image" select="''"/> + + <!-- Enable bookmarks --> + <xsl:param name="fop1.extensions" select="1"/> + + <!-- Do not print out URLs --> + <xsl:param name="ulink.show" select="0"/> + <!--<xsl:param name="show.comments" select="0"/>--> + + <!-- Page setup --> + <xsl:param name="paper.type" select="'A4'"/> + <!--<xsl:param name="double.sided"/>--> + + <!--<xsl:param name="header.column.widths">0 1 0</xsl:param>--> + <!--<xsl:attribute-set name="header.content.properties"> + <xsl:attribute name="font-family">Helvetica</xsl:attribute> + <xsl:attribute name="font-size">12pt</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + </xsl:attribute-set>--> + + <!--<xsl:attribute-set name="footer.content.properties"> + <xsl:attribute name="font-family">Helvetica</xsl:attribute> + <xsl:attribute name="font-size">8pt</xsl:attribute> + </xsl:attribute-set> + <xsl:param name="footer.rule" select="0"/>--> + + <xsl:param name="page.margin.top" select="'3.9cm'"/> + <xsl:param name="page.margin.bottom" select="'3.9cm'"/> + <xsl:param name="page.margin.inner" select="'4cm'"/> + <xsl:param name="page.margin.outer" select="'4cm'"/> + <xsl:param name="body.start.indent" select="'0'"/> + <xsl:param name="body.margin.bottom" select="'1.2cm'"/> + <xsl:attribute-set name="normal.para.spacing"> + <xsl:attribute name="space-before.optimum">0.4em</xsl:attribute> + <xsl:attribute name="space-before.minimum">0.3em</xsl:attribute> + <xsl:attribute name="space-before.maximum">0.5em</xsl:attribute> + </xsl:attribute-set> + <xsl:attribute-set name="list.block.spacing"> + <xsl:attribute name="space-before.optimum">0.4em</xsl:attribute> + <xsl:attribute name="space-before.minimum">0.3em</xsl:attribute> + <xsl:attribute name="space-before.maximum">0.5em</xsl:attribute> + <xsl:attribute name="space-after.optimum">0.4em</xsl:attribute> + <xsl:attribute name="space-after.minimum">0.3em</xsl:attribute> + <xsl:attribute name="space-after.maximum">0.5em</xsl:attribute> + </xsl:attribute-set> + <xsl:attribute-set name="list.item.spacing"> + <xsl:attribute name="space-before.optimum">0.4em</xsl:attribute> + <xsl:attribute name="space-before.minimum">0.3em</xsl:attribute> + <xsl:attribute name="space-before.maximum">0.5em</xsl:attribute> + </xsl:attribute-set> + <xsl:attribute-set name="verbatim.properties"> + <xsl:attribute name="space-before.minimum">0.3em</xsl:attribute> + <xsl:attribute name="space-before.optimum">0.4em</xsl:attribute> + <xsl:attribute name="space-before.maximum">0.5em</xsl:attribute> + <xsl:attribute name="space-after.minimum">0.3em</xsl:attribute> + <xsl:attribute name="space-after.optimum">0.4em</xsl:attribute> + <xsl:attribute name="space-after.maximum">0.5em</xsl:attribute> + <xsl:attribute name="hyphenate">false</xsl:attribute> + <xsl:attribute name="wrap-option">no-wrap</xsl:attribute> + <xsl:attribute name="white-space-collapse">false</xsl:attribute> + <xsl:attribute name="white-space-treatment">preserve</xsl:attribute> + <xsl:attribute name="linefeed-treatment">preserve</xsl:attribute> + <xsl:attribute name="text-align">start</xsl:attribute> + <xsl:attribute name="start-indent">10pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:param name="variablelist.as.blocks" select="0"/> + + <!-- Fonts & colors --> + <xsl:param name="body.font.master" select="10"/> + <xsl:param name="body.font.family" select="'Birka,Gentium Basic,Times'"/> + <xsl:param name="title.font.family" select="'Myriad Pro,Delicious,Helvetica'"/> + <xsl:param name="monospace.font.family" select="'Inconsolata,Courier'"/> + + <xsl:attribute-set name="monospace.verbatim.properties"> + <xsl:attribute name="font-size">.8em</xsl:attribute> + <xsl:attribute name="padding">5pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="nongraphical.admonition.properties"> + <xsl:attribute name="background-color">#F0F0F0</xsl:attribute> + <xsl:attribute name="padding">5pt</xsl:attribute> + </xsl:attribute-set> + + <!--<xsl:param name="shade.verbatim" select="1"/> + <xsl:attribute-set name="shade.verbatim.style"> + <xsl:attribute name="border">0</xsl:attribute> + <xsl:attribute name="background-color">#F0F0F0</xsl:attribute> + </xsl:attribute-set> --> + + <xsl:attribute-set name="section.title.chapter.properties"> + <xsl:attribute name="font-size"> + <xsl:value-of select="$body.font.master * 1.8"/> + <xsl:text>pt</xsl:text> + </xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="section.title.level1.properties"> + <xsl:attribute name="font-size"> + <xsl:value-of select="$body.font.master * 1.7"/> + <xsl:text>pt</xsl:text> + </xsl:attribute> + <!--<xsl:attribute name="border-bottom">1pt solid #505050</xsl:attribute>--> + </xsl:attribute-set> + + <xsl:attribute-set name="section.title.level2.properties"> + <xsl:attribute name="font-size"> + <xsl:value-of select="$body.font.master * 1.4"/> + <xsl:text>pt</xsl:text> + </xsl:attribute> + </xsl:attribute-set> + + <!-- FIXME: Doesn't work + <xsl:attribute-set name="bibliography.title.properties"> + <xsl:attribute name="break-before">page</xsl:attribute> + </xsl:attribute-set> + --> + + <xsl:attribute-set name="toc.line.properties"> + <xsl:attribute name="font-size">10pt</xsl:attribute> + <xsl:attribute name="font-weight"> + <xsl:choose> + <xsl:when test="self::chapter | self::preface | self::appendix">bold</xsl:when> + <xsl:otherwise>normal</xsl:otherwise> + </xsl:choose> + </xsl:attribute> + </xsl:attribute-set> + + <xsl:param name="generate.toc"> + book toc,title + </xsl:param> + +</xsl:stylesheet> + diff --git a/BuildTools/DocBook/Stylesheets/fo/inline.xsl b/BuildTools/DocBook/Stylesheets/fo/inline.xsl new file mode 100644 index 0000000..adb03a7 --- /dev/null +++ b/BuildTools/DocBook/Stylesheets/fo/inline.xsl @@ -0,0 +1,17 @@ +<?xml version='1.0'?> +<xsl:stylesheet + xmlns:fo="http://www.w3.org/1999/XSL/Format" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:template match="comment|remark"> + <xsl:if test="$show.comments != 0"> + <fo:block font-style="italic"> + <fo:inline background-color="#FFEE30"> + <xsl:call-template name="inline.charseq"/> + </fo:inline> + </fo:block> + </xsl:if> + </xsl:template> + +</xsl:stylesheet> diff --git a/BuildTools/DocBook/Stylesheets/fo/titlepage.xsl b/BuildTools/DocBook/Stylesheets/fo/titlepage.xsl new file mode 100644 index 0000000..304c7f8 --- /dev/null +++ b/BuildTools/DocBook/Stylesheets/fo/titlepage.xsl @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" version="1.0" exclude-result-prefixes="exsl"> + <xsl:template name="article.titlepage.separator"> + <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" space-after.minimum="25pt" space-after.maximum="25pt"/> + </xsl:template> +</xsl:stylesheet> diff --git a/BuildTools/DocBook/Stylesheets/html/docbook.xsl b/BuildTools/DocBook/Stylesheets/html/docbook.xsl new file mode 100644 index 0000000..c97545e --- /dev/null +++ b/BuildTools/DocBook/Stylesheets/html/docbook.xsl @@ -0,0 +1,34 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + <!-- Include other stylesheets --> + <xsl:import href="docbook-xsl:/html/docbook.xsl"/> + <xsl:include href="../common/params.xsl" /> + <xsl:include href="../common/inline.xsl" /> + <xsl:output method="html" encoding="UTF-8" indent="no"/> + + <xsl:param name="use.extensions" select="0"/> + <xsl:param name="section.autolabel" select="'1'"/> + + <xsl:param name="generate.toc"> + appendix nop + article/appendix nop + article toc,title + book toc,title + chapter nop + part nop + preface nop + qandadiv nop + qandaset nop + reference nop + sect1 nop + sect2 nop + sect3 nop + sect4 nop + sect5 nop + section nop + set nop + </xsl:param> + +</xsl:stylesheet> + |