diff options
author | Gary Oberbrunner <garyo@oberbrunner.com> | 2013-11-10 19:55:24 (GMT) |
---|---|---|
committer | Gary Oberbrunner <garyo@oberbrunner.com> | 2013-11-10 19:55:24 (GMT) |
commit | 40b0c82446f7acba626424abcd55ecf157d2bdc7 (patch) | |
tree | b13805434b8db4150b113b93921066dc402a63aa /doc/man | |
parent | a8261e0d41be63ca45462fb0f40e8ed1339cc22e (diff) | |
parent | ef9d8a0031b3ca6faabb0746eeb2a7da519fb805 (diff) | |
download | SCons-40b0c82446f7acba626424abcd55ecf157d2bdc7.zip SCons-40b0c82446f7acba626424abcd55ecf157d2bdc7.tar.gz SCons-40b0c82446f7acba626424abcd55ecf157d2bdc7.tar.bz2 |
Merged in dirkbaechle/scons (pull request #91)
Adding EPUB as output format for documentation
Diffstat (limited to 'doc/man')
-rw-r--r-- | doc/man/MANIFEST | 3 | ||||
-rw-r--r-- | doc/man/SConstruct | 22 | ||||
-rw-r--r-- | doc/man/cover.jpg | bin | 0 -> 306 bytes | |||
-rw-r--r-- | doc/man/epub.css | 33 | ||||
-rw-r--r-- | doc/man/epub.xsl | 35 | ||||
-rw-r--r-- | doc/man/html.xsl | 4 | ||||
-rw-r--r-- | doc/man/pdf.xsl | 5 | ||||
-rw-r--r-- | doc/man/scons.xml | 3 |
8 files changed, 102 insertions, 3 deletions
diff --git a/doc/man/MANIFEST b/doc/man/MANIFEST index 7f0ad45..4b3ce9f 100644 --- a/doc/man/MANIFEST +++ b/doc/man/MANIFEST @@ -5,8 +5,9 @@ scons.xml sconsign.xml scons-time.xml *.xsl -scons.css +*.css SConstruct +cover.jpg titlepage/bricks.jpg titlepage/mapnik_final_colors.svg titlepage/SCons_path.svg diff --git a/doc/man/SConstruct b/doc/man/SConstruct index cd94021..cfdbb2d 100644 --- a/doc/man/SConstruct +++ b/doc/man/SConstruct @@ -27,7 +27,7 @@ import os env = Environment(ENV={'PATH' : os.environ['PATH']}, - tools=['docbook'], + tools=['docbook','gs','zip'], toolpath=['../../src/engine/SCons/Tool'], DOCBOOK_DEFAULT_XSL_HTML='html.xsl', DOCBOOK_DEFAULT_XSL_PDF='pdf.xsl') @@ -53,3 +53,23 @@ def createManPages(env, target): createManPages(env, "scons") createManPages(env, "sconsign") createManPages(env, "scons-time") + +has_gs = False +if env.WhereIs('gs'): + has_gs = True + +# +# Create the EPUB format +# +if has_gs and has_pdf: + metainf = env.Command('META-INF','',[Mkdir('META-INF'), Mkdir('OEBPS')]) + css = env.Command('OEBPS/epub.css','epub.css',[Copy('OEBPS/epub.css','epub.css')]) + env.Depends(css, metainf) + jpg = env.Gs('OEBPS/cover.jpg','scons-scons.pdf', + GSFLAGS='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -dJPEGQ=100 -r72x72 -q') + env.Depends(jpg, metainf) + oebps = env.DocbookXslt('OEBPS/toc.ncx', 'scons_db.xml', xsl='epub.xsl') + env.Depends(oebps, jpg) + env.Zip('scons-man.epub', 'OEBPS', ZIPFLAGS='-Xr9D') + env.Clean(oebps, Glob('OEBPS/*.*')) + env.Clean(oebps, Glob('META-INF/*.*')) diff --git a/doc/man/cover.jpg b/doc/man/cover.jpg Binary files differnew file mode 100644 index 0000000..e2c2cb3 --- /dev/null +++ b/doc/man/cover.jpg diff --git a/doc/man/epub.css b/doc/man/epub.css new file mode 100644 index 0000000..31cebe5 --- /dev/null +++ b/doc/man/epub.css @@ -0,0 +1,33 @@ +/* This defines styles and classes used in the book */ +body { } +code { font-family: monospace; } +h1, h2, h3, h4, h5, h6 { text-align: center; margin-bottom:2em;} +h1.title { } +h2.author { } +p{ + padding:0; + margin:0; + text-indent:2em; +} +blockquote{ + margin-left:3em; + margin-right:3em; +} +.caption{ + text-align:center; + font-style:italic; + margin-bottom:1em; + margin-top:.2em; + font-size:.8em; +} +blockquote > p{ + text-indent:0; + margin-bottom:1em; +} +img{ + display:block; + margin-left: auto; + margin-right: auto; + text-align:center; + margin-top:1em; +} diff --git a/doc/man/epub.xsl b/doc/man/epub.xsl new file mode 100644 index 0000000..bc1d4b3 --- /dev/null +++ b/doc/man/epub.xsl @@ -0,0 +1,35 @@ +<?xml version='1.0'?>
+<!--
+
+ __COPYRIGHT__
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+ KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+-->
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+
+ <xsl:import href="../../src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/epub/docbook.xsl"/>
+
+<xsl:param name="html.stylesheet" select="'epub.css'"/>
+
+</xsl:stylesheet>
diff --git a/doc/man/html.xsl b/doc/man/html.xsl index 71a847a..864af88 100644 --- a/doc/man/html.xsl +++ b/doc/man/html.xsl @@ -51,5 +51,9 @@ reference title set toc,title
</xsl:param>
+<!-- Prevent our EPUB cover image from getting included -->
+<xsl:template match="mediaobject[@role = 'cover']">
+</xsl:template>
+
</xsl:stylesheet>
diff --git a/doc/man/pdf.xsl b/doc/man/pdf.xsl index 652975f..f314103 100644 --- a/doc/man/pdf.xsl +++ b/doc/man/pdf.xsl @@ -67,5 +67,8 @@ set toc,title <xsl:apply-templates select="." mode="vl.as.blocks"/>
</xsl:template>
-</xsl:stylesheet>
+<!-- Prevent our EPUB cover image from getting printed to the PDF -->
+<xsl:template match="mediaobject[@role = 'cover']">
+</xsl:template>
+</xsl:stylesheet>
diff --git a/doc/man/scons.xml b/doc/man/scons.xml index ab5d35f..5560847 100644 --- a/doc/man/scons.xml +++ b/doc/man/scons.xml @@ -60,6 +60,9 @@ </copyright> <releaseinfo>version &buildversion;</releaseinfo> + + <mediaobject role="cover"><imageobject><imagedata fileref="cover.jpg" format="JPG"/></imageobject></mediaobject> + </referenceinfo> <title>SCons &buildversion;</title> |