summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-03-28 20:22:32 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-03-28 20:22:32 (GMT)
commit335d3d25e07ddcf7c00ba3b2550858a2374dd3db (patch)
tree26a5d95818e3e12ac2811903fe815044fa7f6d73 /BuildTools
parent3afa4f741c26360245dc313bc368f508b26a6b96 (diff)
downloadswift-contrib-335d3d25e07ddcf7c00ba3b2550858a2374dd3db.zip
swift-contrib-335d3d25e07ddcf7c00ba3b2550858a2374dd3db.tar.bz2
Moved DocBook module.
Diffstat (limited to 'BuildTools')
-rw-r--r--BuildTools/DocBook/Fonts/Delicious/Delicious-Bold.ttfbin0 -> 23976 bytes
-rw-r--r--BuildTools/DocBook/Fonts/Delicious/Delicious-BoldItalic.ttfbin0 -> 25716 bytes
-rw-r--r--BuildTools/DocBook/Fonts/Delicious/Delicious-Heavy.ttfbin0 -> 24440 bytes
-rw-r--r--BuildTools/DocBook/Fonts/Delicious/Delicious-Italic.ttfbin0 -> 24776 bytes
-rw-r--r--BuildTools/DocBook/Fonts/Delicious/Delicious-Roman.ttfbin0 -> 24032 bytes
-rw-r--r--BuildTools/DocBook/Fonts/Delicious/Delicious-SmallCaps.ttfbin0 -> 24444 bytes
-rw-r--r--BuildTools/DocBook/Fonts/Gentium Basic/GenBasB.ttfbin0 -> 271648 bytes
-rw-r--r--BuildTools/DocBook/Fonts/Gentium Basic/GenBasBI.ttfbin0 -> 250668 bytes
-rw-r--r--BuildTools/DocBook/Fonts/Gentium Basic/GenBasI.ttfbin0 -> 263504 bytes
-rw-r--r--BuildTools/DocBook/Fonts/Gentium Basic/GenBasR.ttfbin0 -> 269048 bytes
-rw-r--r--BuildTools/DocBook/Fonts/Gentium Basic/OFL.txt94
-rw-r--r--BuildTools/DocBook/SCons/DocBook.py94
-rw-r--r--BuildTools/DocBook/SCons/FO.py45
-rw-r--r--BuildTools/DocBook/SCons/XSLT.py63
-rw-r--r--BuildTools/DocBook/Stylesheets/common/inline.xsl27
-rw-r--r--BuildTools/DocBook/Stylesheets/common/params.xsl8
-rw-r--r--BuildTools/DocBook/Stylesheets/fo/component.xsl29
-rw-r--r--BuildTools/DocBook/Stylesheets/fo/docbook.test.xsl151
-rw-r--r--BuildTools/DocBook/Stylesheets/fo/docbook.xsl151
-rw-r--r--BuildTools/DocBook/Stylesheets/fo/inline.xsl17
-rw-r--r--BuildTools/DocBook/Stylesheets/fo/titlepage.xsl6
-rw-r--r--BuildTools/DocBook/Stylesheets/html/docbook.xsl34
22 files changed, 719 insertions, 0 deletions
diff --git a/BuildTools/DocBook/Fonts/Delicious/Delicious-Bold.ttf b/BuildTools/DocBook/Fonts/Delicious/Delicious-Bold.ttf
new file mode 100644
index 0000000..692f10c
--- /dev/null
+++ b/BuildTools/DocBook/Fonts/Delicious/Delicious-Bold.ttf
Binary files differ
diff --git a/BuildTools/DocBook/Fonts/Delicious/Delicious-BoldItalic.ttf b/BuildTools/DocBook/Fonts/Delicious/Delicious-BoldItalic.ttf
new file mode 100644
index 0000000..04c68ab
--- /dev/null
+++ b/BuildTools/DocBook/Fonts/Delicious/Delicious-BoldItalic.ttf
Binary files differ
diff --git a/BuildTools/DocBook/Fonts/Delicious/Delicious-Heavy.ttf b/BuildTools/DocBook/Fonts/Delicious/Delicious-Heavy.ttf
new file mode 100644
index 0000000..ac224e8
--- /dev/null
+++ b/BuildTools/DocBook/Fonts/Delicious/Delicious-Heavy.ttf
Binary files differ
diff --git a/BuildTools/DocBook/Fonts/Delicious/Delicious-Italic.ttf b/BuildTools/DocBook/Fonts/Delicious/Delicious-Italic.ttf
new file mode 100644
index 0000000..7ce4e15
--- /dev/null
+++ b/BuildTools/DocBook/Fonts/Delicious/Delicious-Italic.ttf
Binary files differ
diff --git a/BuildTools/DocBook/Fonts/Delicious/Delicious-Roman.ttf b/BuildTools/DocBook/Fonts/Delicious/Delicious-Roman.ttf
new file mode 100644
index 0000000..14349dc
--- /dev/null
+++ b/BuildTools/DocBook/Fonts/Delicious/Delicious-Roman.ttf
Binary files differ
diff --git a/BuildTools/DocBook/Fonts/Delicious/Delicious-SmallCaps.ttf b/BuildTools/DocBook/Fonts/Delicious/Delicious-SmallCaps.ttf
new file mode 100644
index 0000000..4389995
--- /dev/null
+++ b/BuildTools/DocBook/Fonts/Delicious/Delicious-SmallCaps.ttf
Binary files differ
diff --git a/BuildTools/DocBook/Fonts/Gentium Basic/GenBasB.ttf b/BuildTools/DocBook/Fonts/Gentium Basic/GenBasB.ttf
new file mode 100644
index 0000000..0538a00
--- /dev/null
+++ b/BuildTools/DocBook/Fonts/Gentium Basic/GenBasB.ttf
Binary files differ
diff --git a/BuildTools/DocBook/Fonts/Gentium Basic/GenBasBI.ttf b/BuildTools/DocBook/Fonts/Gentium Basic/GenBasBI.ttf
new file mode 100644
index 0000000..786c627
--- /dev/null
+++ b/BuildTools/DocBook/Fonts/Gentium Basic/GenBasBI.ttf
Binary files differ
diff --git a/BuildTools/DocBook/Fonts/Gentium Basic/GenBasI.ttf b/BuildTools/DocBook/Fonts/Gentium Basic/GenBasI.ttf
new file mode 100644
index 0000000..e326cd7
--- /dev/null
+++ b/BuildTools/DocBook/Fonts/Gentium Basic/GenBasI.ttf
Binary files differ
diff --git a/BuildTools/DocBook/Fonts/Gentium Basic/GenBasR.ttf b/BuildTools/DocBook/Fonts/Gentium Basic/GenBasR.ttf
new file mode 100644
index 0000000..6f37980
--- /dev/null
+++ b/BuildTools/DocBook/Fonts/Gentium Basic/GenBasR.ttf
Binary files differ
diff --git a/BuildTools/DocBook/Fonts/Gentium Basic/OFL.txt b/BuildTools/DocBook/Fonts/Gentium Basic/OFL.txt
new file mode 100644
index 0000000..2c09f25
--- /dev/null
+++ b/BuildTools/DocBook/Fonts/Gentium Basic/OFL.txt
@@ -0,0 +1,94 @@
+Copyright (c) 2003-2008 SIL International (http://www.sil.org/),
+with Reserved Font Names "Gentium" and "SIL".
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 1 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that the font
+names of derivative works are changed. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/BuildTools/DocBook/SCons/DocBook.py b/BuildTools/DocBook/SCons/DocBook.py
new file mode 100644
index 0000000..d3ef7c5
--- /dev/null
+++ b/BuildTools/DocBook/SCons/DocBook.py
@@ -0,0 +1,94 @@
+################################################################################
+# DocBook pseudobuilder
+################################################################################
+
+import SCons.Util, SCons.Action
+import xml.dom.minidom, re, os.path, sys
+
+def generate(env) :
+ # Location of stylesheets and catalogs
+ docbook_dir = "#/BuildTools/DocBook"
+ docbook_xsl_style_dir = env.Dir(docbook_dir + "/Stylesheets").abspath
+ docbook_xml_catalog = env.File("catalog.xml").abspath
+ docbook_xml_dir = env.Dir("#/3rdParty/DocBook/XML").abspath
+ docbook_xsl_dir = env.Dir("#/3rdParty/DocBook/XSL").abspath
+ fop_fonts_dir = env.Dir(docbook_dir + "/Fonts").abspath
+
+ # Generates a catalog from paths to external tools
+ def buildCatalog(target, source, env) :
+ catalog = """<?xml version='1.0'?>
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
+ <rewriteSystem
+ systemIdStartString="http://www.oasis-open.org/docbook/xml/4.5/"
+ rewritePrefix="%(docbook_xml_dir)s/" />
+ <rewriteSystem
+ systemIdStartString="docbook-xsl:/"
+ rewritePrefix="%(docbook_xsl_dir)s/" />
+</catalog>"""
+
+ file = open(target[0].abspath, "w")
+ file.write(catalog % {
+ "docbook_xml_dir" : source[0].get_contents(),
+ "docbook_xsl_dir" : source[1].get_contents(),
+ })
+ file.close()
+
+ # Generates a FOP config file
+ def buildFopConfig(target, source, env) :
+ fopcfg = """<fop version=\"1.0\">
+ <renderers>
+ <renderer mime=\"application/pdf\">
+ <fonts>
+ <directory recursive=\"true\">%(fonts_dir)s</directory>
+ </fonts>
+ </renderer>
+ </renderers>
+</fop>"""
+
+ file = open(target[0].abspath, "w")
+ file.write(fopcfg % {
+ "fonts_dir" : source[0].get_contents()
+ })
+ file.close()
+
+ # Builds a DocBook file
+ def buildDocBook(env, source) :
+ db_env = env.Clone()
+ db_env["XMLCATALOGS"] = [docbook_xml_catalog]
+ db_env["ENV"].update({"OS" : os.environ.get("OS", "")})
+
+ db_env["XMLLINT"] = env.WhereIs("xmllint")
+ db_env["XSLT"] = env.WhereIs("xsltproc")
+ db_env["FO"] = env.WhereIs("fop")
+
+ if not db_env["XMLLINT"] or not db_env["XSLT"] :
+ return
+
+ # PDF generation
+ if db_env["FO"] :
+ fo = db_env.XSLT(os.path.splitext(source)[0] + ".fo", source,
+ XSLTSTYLESHEET = db_env["DOCBOOK_XSL_FO"])
+ pdf = db_env.FO(fo)
+
+ # HTML generation
+ db_env.XSLT(os.path.splitext(source)[0] + ".html", source,
+ XSLTSTYLESHEET = db_env["DOCBOOK_XSL_HTML"])
+
+ # Import tools
+ env.Tool("FO", toolpath = [docbook_dir + "/SCons"])
+ env.Tool("XSLT", toolpath = [docbook_dir + "/SCons"])
+
+ # Catalog file generation
+ env.Command("catalog.xml", [env.Value(docbook_xml_dir), env.Value(docbook_xsl_dir)], SCons.Action.Action(buildCatalog, cmdstr = "$GENCOMSTR"))
+
+ # FO config file generation
+ env["FOCFG"] = env.File("fop.cfg").abspath
+ env.Command("fop.cfg", [env.Value(fop_fonts_dir)], SCons.Action.Action(buildFopConfig, cmdstr = "$GENCOMSTR"))
+
+ # DocBook stylesheets
+ env["DOCBOOK_XSL_FO"] = docbook_xsl_style_dir + "/fo/docbook.xsl"
+ env["DOCBOOK_XSL_HTML"] = docbook_xsl_style_dir + "/html/docbook.xsl"
+ env.AddMethod(buildDocBook, "DocBook")
+
+def exists(env) :
+ return True
diff --git a/BuildTools/DocBook/SCons/FO.py b/BuildTools/DocBook/SCons/FO.py
new file mode 100644
index 0000000..c7596d6
--- /dev/null
+++ b/BuildTools/DocBook/SCons/FO.py
@@ -0,0 +1,45 @@
+import SCons.Util
+import xml.dom.minidom, re
+
+################################################################################
+# XSL-FO builder
+################################################################################
+
+def generate(env) :
+ def generate_actions(source, target, env, for_signature) :
+ if len(env["FOCFG"]) > 0 :
+ cmd = "$FO -c $FOCFG $FOFLAGS $SOURCE $TARGET"
+ else :
+ cmd = "$FO $FOFLAGS $SOURCE $TARGET"
+ return SCons.Action.Action(cmd, cmdstr = "$FOCOMSTR")
+
+ def modify_sources(target, source, env) :
+ if len(env["FOCFG"]) > 0 :
+ source.append(env["FOCFG"])
+ return target, source
+
+ def scan_fo(node, env, path) :
+ dependencies = set()
+ try :
+ document = xml.dom.minidom.parseString(node.get_contents())
+ except xml.parsers.expat.ExpatError:
+ return []
+ for include in document.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Format", "external-graphic") :
+ m = re.match("url\((.*)\)", include.getAttribute("src"))
+ if m :
+ dependencies.add(m.group(1))
+ return list(dependencies)
+
+ env["FO"] = "fop"
+ env["FOFLAGS"] = ""
+ env["FOCFG"] = ""
+ env["BUILDERS"]["FO"] = SCons.Builder.Builder(
+ generator = generate_actions,
+ emitter = modify_sources,
+ source_scanner = SCons.Scanner.Scanner(function = scan_fo, skeys = [".fo"]),
+ suffix = ".pdf",
+ src_suffix = ".fo"
+ )
+
+def exists(env) :
+ return True
diff --git a/BuildTools/DocBook/SCons/XSLT.py b/BuildTools/DocBook/SCons/XSLT.py
new file mode 100644
index 0000000..83b5ec2
--- /dev/null
+++ b/BuildTools/DocBook/SCons/XSLT.py
@@ -0,0 +1,63 @@
+import SCons.Util
+import xml.dom.minidom, os, os.path
+
+################################################################################
+# XSLT processor
+################################################################################
+
+def generate(env) :
+ def generate_actions(source, target, env, for_signature) :
+ if not env.has_key("XSLTSTYLESHEET") :
+ raise SCons.Errors.UserError, "The XSLTSTYLESHEET construction variable must be defined"
+
+ # Process the XML catalog files
+ # FIXME: It's probably not clean to do an ENV assignment globally
+ env["ENV"]["XML_CATALOG_FILES"] = " ".join(env.get("XMLCATALOGS", ""))
+
+ # Build the XMLLint command
+ xmllintcmd = ["$XMLLINT", "--nonet", "--xinclude", "--postvalid", "--noout", "$SOURCE"]
+
+ # Build the XSLT command
+ xsltcmd = ["$XSLT", "--nonet", "--xinclude"]
+ for (param, value) in env["XSLTPARAMS"] :
+ xsltcmd += ["--stringparam", param, value]
+ xsltcmd += ["-o", "$TARGET", "$XSLTSTYLESHEET", "$SOURCE"]
+
+ return [
+ SCons.Action.Action([xmllintcmd], cmdstr = "$XMLLINTCOMSTR"),
+ SCons.Action.Action([xsltcmd], cmdstr = "$XSLTCOMSTR")]
+
+ def modify_sources(target, source, env) :
+ if len(env["FOCFG"]) > 0 :
+ source.append(env["FOCFG"])
+ source.append(env.get("XMLCATALOGS", []))
+ return target, source
+
+ def scan_xml(node, env, path) :
+ dependencies = set()
+ nodes = [node]
+ while len(nodes) > 0 :
+ node = nodes.pop()
+ try :
+ document = xml.dom.minidom.parseString(node.get_contents())
+ except xml.parsers.expat.ExpatError:
+ continue
+ for include in document.getElementsByTagNameNS("http://www.w3.org/2001/XInclude", "include") :
+ include_file = include.getAttribute("href")
+ dependencies.add(include_file)
+ if include.getAttribute("parse") != "text" :
+ nodes.append(env.File(include_file))
+ return list(dependencies)
+
+ env["XMLLINT"] = "xmllint"
+ env["XSLT"] = "xsltproc"
+ env["XSLTPARAMS"] = []
+ env["BUILDERS"]["XSLT"] = SCons.Builder.Builder(
+ generator = generate_actions,
+ emitter = modify_sources,
+ source_scanner = SCons.Scanner.Scanner(function = scan_xml),
+ src_suffix = ".xml"
+ )
+
+def exists(env) :
+ return True
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>
+