From 335d3d25e07ddcf7c00ba3b2550858a2374dd3db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Sun, 28 Mar 2010 22:22:32 +0200 Subject: Moved DocBook module. 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 Binary files /dev/null and b/BuildTools/DocBook/Fonts/Delicious/Delicious-Bold.ttf 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 Binary files /dev/null and b/BuildTools/DocBook/Fonts/Delicious/Delicious-BoldItalic.ttf 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 Binary files /dev/null and b/BuildTools/DocBook/Fonts/Delicious/Delicious-Heavy.ttf 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 Binary files /dev/null and b/BuildTools/DocBook/Fonts/Delicious/Delicious-Italic.ttf 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 Binary files /dev/null and b/BuildTools/DocBook/Fonts/Delicious/Delicious-Roman.ttf 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 Binary files /dev/null and b/BuildTools/DocBook/Fonts/Delicious/Delicious-SmallCaps.ttf 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 Binary files /dev/null and b/BuildTools/DocBook/Fonts/Gentium Basic/GenBasB.ttf 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 Binary files /dev/null and b/BuildTools/DocBook/Fonts/Gentium Basic/GenBasBI.ttf 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 Binary files /dev/null and b/BuildTools/DocBook/Fonts/Gentium Basic/GenBasI.ttf 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 Binary files /dev/null and b/BuildTools/DocBook/Fonts/Gentium Basic/GenBasR.ttf 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 = """ + + + +""" + + 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 = """ + + + + %(fonts_dir)s + + + +""" + + 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + 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 @@ + + + + + + + + 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.4em + 0.3em + 0.5em + + + 0.4em + 0.3em + 0.5em + 0.4em + 0.3em + 0.5em + + + 0.4em + 0.3em + 0.5em + + + 0.3em + 0.4em + 0.5em + 0.3em + 0.4em + 0.5em + false + no-wrap + false + preserve + preserve + start + 10pt + + + + + + + + + + + + .8em + 5pt + + + + #F0F0F0 + 5pt + + + + + + + + pt + + + + + + + pt + + + + + + + + pt + + + + + + + 10pt + + + bold + normal + + + + + + book toc,title + + + + 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.4em + 0.3em + 0.5em + + + 0.4em + 0.3em + 0.5em + 0.4em + 0.3em + 0.5em + + + 0.4em + 0.3em + 0.5em + + + 0.3em + 0.4em + 0.5em + 0.3em + 0.4em + 0.5em + false + no-wrap + false + preserve + preserve + start + 10pt + + + + + + + + + + + + .8em + 5pt + + + + #F0F0F0 + 5pt + + + + + + + + pt + + + + + + + pt + + + + + + + + pt + + + + + + + 10pt + + + bold + normal + + + + + + book toc,title + + + + 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 @@ + + + + + + + + + + + + + + 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 @@ + + + + + + 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 @@ + + + + + + + + + + + + + + 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 + + + + diff --git a/DocBook/Fonts/Delicious/Delicious-Bold.ttf b/DocBook/Fonts/Delicious/Delicious-Bold.ttf deleted file mode 100644 index 692f10c..0000000 Binary files a/DocBook/Fonts/Delicious/Delicious-Bold.ttf and /dev/null differ diff --git a/DocBook/Fonts/Delicious/Delicious-BoldItalic.ttf b/DocBook/Fonts/Delicious/Delicious-BoldItalic.ttf deleted file mode 100644 index 04c68ab..0000000 Binary files a/DocBook/Fonts/Delicious/Delicious-BoldItalic.ttf and /dev/null differ diff --git a/DocBook/Fonts/Delicious/Delicious-Heavy.ttf b/DocBook/Fonts/Delicious/Delicious-Heavy.ttf deleted file mode 100644 index ac224e8..0000000 Binary files a/DocBook/Fonts/Delicious/Delicious-Heavy.ttf and /dev/null differ diff --git a/DocBook/Fonts/Delicious/Delicious-Italic.ttf b/DocBook/Fonts/Delicious/Delicious-Italic.ttf deleted file mode 100644 index 7ce4e15..0000000 Binary files a/DocBook/Fonts/Delicious/Delicious-Italic.ttf and /dev/null differ diff --git a/DocBook/Fonts/Delicious/Delicious-Roman.ttf b/DocBook/Fonts/Delicious/Delicious-Roman.ttf deleted file mode 100644 index 14349dc..0000000 Binary files a/DocBook/Fonts/Delicious/Delicious-Roman.ttf and /dev/null differ diff --git a/DocBook/Fonts/Delicious/Delicious-SmallCaps.ttf b/DocBook/Fonts/Delicious/Delicious-SmallCaps.ttf deleted file mode 100644 index 4389995..0000000 Binary files a/DocBook/Fonts/Delicious/Delicious-SmallCaps.ttf and /dev/null differ diff --git a/DocBook/Fonts/Gentium Basic/GenBasB.ttf b/DocBook/Fonts/Gentium Basic/GenBasB.ttf deleted file mode 100644 index 0538a00..0000000 Binary files a/DocBook/Fonts/Gentium Basic/GenBasB.ttf and /dev/null differ diff --git a/DocBook/Fonts/Gentium Basic/GenBasBI.ttf b/DocBook/Fonts/Gentium Basic/GenBasBI.ttf deleted file mode 100644 index 786c627..0000000 Binary files a/DocBook/Fonts/Gentium Basic/GenBasBI.ttf and /dev/null differ diff --git a/DocBook/Fonts/Gentium Basic/GenBasI.ttf b/DocBook/Fonts/Gentium Basic/GenBasI.ttf deleted file mode 100644 index e326cd7..0000000 Binary files a/DocBook/Fonts/Gentium Basic/GenBasI.ttf and /dev/null differ diff --git a/DocBook/Fonts/Gentium Basic/GenBasR.ttf b/DocBook/Fonts/Gentium Basic/GenBasR.ttf deleted file mode 100644 index 6f37980..0000000 Binary files a/DocBook/Fonts/Gentium Basic/GenBasR.ttf and /dev/null differ diff --git a/DocBook/Fonts/Gentium Basic/OFL.txt b/DocBook/Fonts/Gentium Basic/OFL.txt deleted file mode 100644 index 2c09f25..0000000 --- a/DocBook/Fonts/Gentium Basic/OFL.txt +++ /dev/null @@ -1,94 +0,0 @@ -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/DocBook/SCons/DocBook.py b/DocBook/SCons/DocBook.py deleted file mode 100644 index 8d0b171..0000000 --- a/DocBook/SCons/DocBook.py +++ /dev/null @@ -1,86 +0,0 @@ -################################################################################ -# 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 = "#/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 = """ - - - -""" - - 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 = """ - - - - %(fonts_dir)s - - - -""" - - 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", "")}) - - # PDF generation - 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/DocBook/SCons/FO.py b/DocBook/SCons/FO.py deleted file mode 100644 index c7596d6..0000000 --- a/DocBook/SCons/FO.py +++ /dev/null @@ -1,45 +0,0 @@ -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/DocBook/SCons/XSLT.py b/DocBook/SCons/XSLT.py deleted file mode 100644 index 83b5ec2..0000000 --- a/DocBook/SCons/XSLT.py +++ /dev/null @@ -1,63 +0,0 @@ -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/DocBook/Stylesheets/common/inline.xsl b/DocBook/Stylesheets/common/inline.xsl deleted file mode 100644 index 5f39338..0000000 --- a/DocBook/Stylesheets/common/inline.xsl +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DocBook/Stylesheets/common/params.xsl b/DocBook/Stylesheets/common/params.xsl deleted file mode 100644 index 6da03c0..0000000 --- a/DocBook/Stylesheets/common/params.xsl +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/DocBook/Stylesheets/fo/component.xsl b/DocBook/Stylesheets/fo/component.xsl deleted file mode 100644 index 829695d..0000000 --- a/DocBook/Stylesheets/fo/component.xsl +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DocBook/Stylesheets/fo/docbook.test.xsl b/DocBook/Stylesheets/fo/docbook.test.xsl deleted file mode 100644 index c6d6106..0000000 --- a/DocBook/Stylesheets/fo/docbook.test.xsl +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.4em - 0.3em - 0.5em - - - 0.4em - 0.3em - 0.5em - 0.4em - 0.3em - 0.5em - - - 0.4em - 0.3em - 0.5em - - - 0.3em - 0.4em - 0.5em - 0.3em - 0.4em - 0.5em - false - no-wrap - false - preserve - preserve - start - 10pt - - - - - - - - - - - - .8em - 5pt - - - - #F0F0F0 - 5pt - - - - - - - - pt - - - - - - - pt - - - - - - - - pt - - - - - - - 10pt - - - bold - normal - - - - - - book toc,title - - - - diff --git a/DocBook/Stylesheets/fo/docbook.xsl b/DocBook/Stylesheets/fo/docbook.xsl deleted file mode 100644 index 1a27317..0000000 --- a/DocBook/Stylesheets/fo/docbook.xsl +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.4em - 0.3em - 0.5em - - - 0.4em - 0.3em - 0.5em - 0.4em - 0.3em - 0.5em - - - 0.4em - 0.3em - 0.5em - - - 0.3em - 0.4em - 0.5em - 0.3em - 0.4em - 0.5em - false - no-wrap - false - preserve - preserve - start - 10pt - - - - - - - - - - - - .8em - 5pt - - - - #F0F0F0 - 5pt - - - - - - - - pt - - - - - - - pt - - - - - - - - pt - - - - - - - 10pt - - - bold - normal - - - - - - book toc,title - - - - diff --git a/DocBook/Stylesheets/fo/inline.xsl b/DocBook/Stylesheets/fo/inline.xsl deleted file mode 100644 index adb03a7..0000000 --- a/DocBook/Stylesheets/fo/inline.xsl +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - diff --git a/DocBook/Stylesheets/fo/titlepage.xsl b/DocBook/Stylesheets/fo/titlepage.xsl deleted file mode 100644 index 304c7f8..0000000 --- a/DocBook/Stylesheets/fo/titlepage.xsl +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/DocBook/Stylesheets/html/docbook.xsl b/DocBook/Stylesheets/html/docbook.xsl deleted file mode 100644 index c97545e..0000000 --- a/DocBook/Stylesheets/html/docbook.xsl +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - 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 - - - - diff --git a/Documentation/SConscript b/Documentation/SConscript index 45dd35a..f4d22db 100644 --- a/Documentation/SConscript +++ b/Documentation/SConscript @@ -1,4 +1,4 @@ Import("env") -#if env["SCONS_STAGE"] == "build" : -# SConscript(dirs = ["SwiftenDevelopersGuide"]) +if env["SCONS_STAGE"] == "build" : + SConscript(dirs = ["SwiftenDevelopersGuide"]) diff --git a/Documentation/SwiftenDevelopersGuide/SConscript b/Documentation/SwiftenDevelopersGuide/SConscript index 5e19a05..3aec8d0 100644 --- a/Documentation/SwiftenDevelopersGuide/SConscript +++ b/Documentation/SwiftenDevelopersGuide/SConscript @@ -1,5 +1,5 @@ Import("env") -env.Tool("DocBook", toolpath = ["#/DocBook/SCons"]) +env.Tool("DocBook", toolpath = ["#/BuildTools/DocBook/SCons"]) env.DocBook("SwiftenDevelopersGuide.xml") -- cgit v0.10.2-6-g49f6