Commits

Gary Oberbrunner committed 85c78dc Merge

Merged in dirkbaechle/scons (pull request #91)

Adding EPUB as output format for documentation

Comments (0)

Files changed (29)

 fop = whereis('fop')
 xep = whereis('xep')
 epydoc_cli = whereis('epydoc')
+gs = whereis('gs')
 
 #
 #
         env.Execute(Mkdir(os.path.join(build_dir, *(dbpath + ['html']))))
         env.Execute(Mkdir(os.path.join(build_dir, *(dbpath + ['fo']))))
         env.Execute(Mkdir(os.path.join(build_dir, *(dbpath + ['manpages']))))
+        env.Execute(Mkdir(os.path.join(build_dir, *(dbpath + ['epub']))))
+        env.Execute(Mkdir(os.path.join(build_dir, *(dbpath + ['xhtml-1_1']))))
         env.Execute(Copy(os.path.join(build_dir, *dbpath),
                          os.path.join('..', *(dbpath + ['VERSION']))))
         for g in glob.glob(os.path.join('..', *(dbpath + ['common', '*.*']))):
             env.Execute(Copy(os.path.join(build_dir, *(dbpath + ['fo'])), g))
         for g in glob.glob(os.path.join('..', *(dbpath + ['manpages', '*.*']))):
             env.Execute(Copy(os.path.join(build_dir, *(dbpath + ['manpages'])), g))
+        for g in glob.glob(os.path.join('..', *(dbpath + ['epub', '*.xsl']))):
+            env.Execute(Copy(os.path.join(build_dir, *(dbpath + ['epub'])), g))
+        for g in glob.glob(os.path.join('..', *(dbpath + ['xhtml-1_1', '*.*']))):
+            env.Execute(Copy(os.path.join(build_dir, *(dbpath + ['xhtml-1_1'])), g))
+
+        #
+        # Copy additional Tools (gs, zip)
+        #
+        toolpath = ['src', 'engine', 'SCons', 'Tool']
+        env.Execute(Copy(os.path.join(build_dir, *toolpath),
+                         os.path.join('..', *(toolpath + ['gs.py']))))
+        env.Execute(Copy(os.path.join(build_dir, *toolpath),
+                         os.path.join('..', *(toolpath + ['zip.py']))))
+
 
     #
     # Each document will live in its own subdirectory.  List them here
             #'python10' : ['chtml','html','pdf'],
             'reference' : ['chtml','html','pdf'],
             #'developer' : ['chtml','html','pdf'],
-            'user' : ['chtml','html','pdf'],
-            'man' : ['man']
+            'user' : ['chtml','html','pdf','epub'],
+            'man' : ['man','epub']
            }
     # The names of the target files for the MAN pages
     man_page_list = ['scons.1','scons-time.1','sconsign.1']
         htmlindex = os.path.join(htmldir, 'index.html')
         html = os.path.join(build, 'HTML', 'scons-%s.html' % doc)
         pdf = os.path.join(build, 'PDF', 'scons-%s.pdf' % doc)
+        epub = os.path.join(build, 'EPUB', 'scons-%s.epub' % doc)
         if 'chtml' in docs[doc]:
             env.Install(htmldir, Glob(os.path.join(build, doc,'scons-%s' % doc, '*.html')))
             tar_deps.extend([htmlindex])
 
             tar_deps.append(pdf)
             tar_list.append(pdf)
+
+        if 'epub' in docs[doc] and gs:
+            env.InstallAs(epub, os.path.join(build, doc,'scons-%s.epub' % doc))
+            Local(epub)
+            env.Ignore(epub, version_xml)
+
+            tar_deps.append(epub)
+            tar_list.append(epub)
             
         if 'man' in docs[doc]:
             #

doc/editor_configs/serna/scons/xsd/dbpoolx.xsd

         </xs:documentation>
       </xs:annotation>
       <xs:choice minOccurs="0" maxOccurs="unbounded">
-        <xs:group ref="para.char.mix"/>
         <xs:group ref="para.mix"/>
         <xs:group ref="tool.mix"/>
       </xs:choice>
         </xs:documentation>
       </xs:annotation>
       <xs:choice minOccurs="0" maxOccurs="unbounded">
-        <xs:group ref="para.char.mix"/>
         <xs:group ref="para.mix"/>
         <xs:group ref="tool.mix"/>
       </xs:choice>
         </xs:documentation>
       </xs:annotation>
       <xs:choice minOccurs="0" maxOccurs="unbounded">
-        <xs:group ref="para.char.mix"/>
         <xs:group ref="para.mix"/>
         <xs:element ref="summary"/>
       </xs:choice>

doc/editor_configs/xmlmind/addon/config/scons/scons_xsd/dbpoolx.xsd

         </xs:documentation>
       </xs:annotation>
       <xs:choice minOccurs="0" maxOccurs="unbounded">
-        <xs:group ref="para.char.mix"/>
         <xs:group ref="para.mix"/>
         <xs:group ref="tool.mix"/>
       </xs:choice>
         </xs:documentation>
       </xs:annotation>
       <xs:choice minOccurs="0" maxOccurs="unbounded">
-        <xs:group ref="para.char.mix"/>
         <xs:group ref="para.mix"/>
         <xs:group ref="tool.mix"/>
       </xs:choice>
         </xs:documentation>
       </xs:annotation>
       <xs:choice minOccurs="0" maxOccurs="unbounded">
-        <xs:group ref="para.char.mix"/>
         <xs:group ref="para.mix"/>
         <xs:element ref="summary"/>
       </xs:choice>

doc/generated/builders.gen

 </example_commands>
 </listitem>
   </varlistentry>
+  <varlistentry id="b-Gs">
+    <term>
+      <function>Gs()</function>
+    </term>
+    <term>
+      <function>env.Gs()</function>
+    </term>
+    <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+A Builder for explicitly calling the <literal>gs</literal> executable.
+Depending on the underlying OS, the different names <literal>gs</literal>,
+<literal>gsos2</literal> and <literal>gswin32c</literal>
+are tried.
+</para>
+<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">env = Environment(tools=['gs'])
+env.Gs('cover.jpg','scons-scons.pdf',
+       GSFLAGS='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -q') 
+       )
+</example_commands>
+</listitem>
+  </varlistentry>
   <varlistentry id="b-Install">
     <term>
       <function>Install()</function>

doc/generated/builders.mod

 <!ENTITY b-DocbookXInclude "<function xmlns='http://www.scons.org/dbxsd/v1.0'>DocbookXInclude</function>">
 <!ENTITY b-DocbookXslt "<function xmlns='http://www.scons.org/dbxsd/v1.0'>DocbookXslt</function>">
 <!ENTITY b-DVI "<function xmlns='http://www.scons.org/dbxsd/v1.0'>DVI</function>">
+<!ENTITY b-Gs "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Gs</function>">
 <!ENTITY b-Install "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Install</function>">
 <!ENTITY b-InstallAs "<function xmlns='http://www.scons.org/dbxsd/v1.0'>InstallAs</function>">
 <!ENTITY b-InstallVersionedLib "<function xmlns='http://www.scons.org/dbxsd/v1.0'>InstallVersionedLib</function>">
 <!ENTITY b-env-DocbookXInclude "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.DocbookXInclude</function>">
 <!ENTITY b-env-DocbookXslt "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.DocbookXslt</function>">
 <!ENTITY b-env-DVI "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.DVI</function>">
+<!ENTITY b-env-Gs "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Gs</function>">
 <!ENTITY b-env-Install "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Install</function>">
 <!ENTITY b-env-InstallAs "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.InstallAs</function>">
 <!ENTITY b-env-InstallVersionedLib "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.InstallVersionedLib</function>">
 <!ENTITY b-link-DocbookXInclude "<link linkend='b-DocbookXInclude' xmlns='http://www.scons.org/dbxsd/v1.0'><function>DocbookXInclude</function></link>">
 <!ENTITY b-link-DocbookXslt "<link linkend='b-DocbookXslt' xmlns='http://www.scons.org/dbxsd/v1.0'><function>DocbookXslt</function></link>">
 <!ENTITY b-link-DVI "<link linkend='b-DVI' xmlns='http://www.scons.org/dbxsd/v1.0'><function>DVI</function></link>">
+<!ENTITY b-link-Gs "<link linkend='b-Gs' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Gs</function></link>">
 <!ENTITY b-link-Install "<link linkend='b-Install' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Install</function></link>">
 <!ENTITY b-link-InstallAs "<link linkend='b-InstallAs' xmlns='http://www.scons.org/dbxsd/v1.0'><function>InstallAs</function></link>">
 <!ENTITY b-link-InstallVersionedLib "<link linkend='b-InstallVersionedLib' xmlns='http://www.scons.org/dbxsd/v1.0'><function>InstallVersionedLib</function></link>">
 <!ENTITY b-link-env-DocbookXInclude "<link linkend='b-DocbookXInclude' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.DocbookXInclude</function></link>">
 <!ENTITY b-link-env-DocbookXslt "<link linkend='b-DocbookXslt' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.DocbookXslt</function></link>">
 <!ENTITY b-link-env-DVI "<link linkend='b-DVI' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.DVI</function></link>">
+<!ENTITY b-link-env-Gs "<link linkend='b-Gs' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Gs</function></link>">
 <!ENTITY b-link-env-Install "<link linkend='b-Install' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Install</function></link>">
 <!ENTITY b-link-env-InstallAs "<link linkend='b-InstallAs' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.InstallAs</function></link>">
 <!ENTITY b-link-env-InstallVersionedLib "<link linkend='b-InstallVersionedLib' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.InstallVersionedLib</function></link>">

doc/generated/tools.gen

     <term>gs</term>
     <listitem>
 <para xmlns="http://www.scons.org/dbxsd/v1.0">
-Set construction variables for Ghostscript.
+This Tool sets the required construction variables for working with
+the Ghostscript command. It also registers an appropriate Action
+with the PDF Builder (<link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-PDF"><function>PDF</function></link>), such that the conversion from
+PS/EPS to PDF happens automatically for the TeX/LaTeX toolchain.
+Finally, it adds an explicit Ghostscript Builder (<link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-Gs"><function>Gs</function></link>) to the
+environment.
 </para>
 <para>Sets:  &cv-link-GS;, &cv-link-GSCOM;, &cv-link-GSFLAGS;.</para><para>Uses:  &cv-link-GSCOMSTR;.</para></listitem>
   </varlistentry>

doc/generated/variables.gen

     <term>GS</term>
     <listitem>
 <para xmlns="http://www.scons.org/dbxsd/v1.0">
-The Ghostscript program used to convert PostScript to PDF files.
+The Ghostscript program used, e.g. to convert PostScript to PDF files.
 </para>
 </listitem>
   </varlistentry>
     <term>GSCOM</term>
     <listitem>
 <para xmlns="http://www.scons.org/dbxsd/v1.0">
-The Ghostscript command line used to convert PostScript to PDF files.
+The full Ghostscript command line used for the conversion process. Its default
+value is <quote><literal>$GS $GSFLAGS -sOutputFile=$TARGET $SOURCES</literal></quote>.
 </para>
 </listitem>
   </varlistentry>
     <listitem>
 <para xmlns="http://www.scons.org/dbxsd/v1.0">
 The string displayed when
-Ghostscript is used to convert
-a PostScript file to a PDF file.
-If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-GSCOM"><envar>$GSCOM</envar></link> (the command line) is displayed.
+Ghostscript is called for the conversion process.
+If this is not set (the default), then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-GSCOM"><envar>$GSCOM</envar></link> (the command line) is displayed.
 </para>
 </listitem>
   </varlistentry>
     <term>GSFLAGS</term>
     <listitem>
 <para xmlns="http://www.scons.org/dbxsd/v1.0">
-General options passed to the Ghostscript program
-when converting PostScript to PDF files.
+General options passed to the Ghostscript program,
+when converting PostScript to PDF files for example. Its default value
+is <quote><literal>-dNOPAUSE -dBATCH -sDEVICE=pdfwrite</literal></quote>
 </para>
 </listitem>
   </varlistentry>
 Internal ``macro''. Computes locale (language) name based on target filename
 (default: <literal>'${TARGET.filebase}' </literal>).
 </para>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+See <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="t-msginit"><literal>msginit</literal></link> tool and <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-POInit"><function>POInit</function></link> builder.
+</para>
 </listitem>
   </varlistentry>
   <varlistentry id="cv-MSGMERGE">
 sconsign.xml
 scons-time.xml
 *.xsl
-scons.css
+*.css
 SConstruct
+cover.jpg
 titlepage/bricks.jpg
 titlepage/mapnik_final_colors.svg
 titlepage/SCons_path.svg

doc/man/SConstruct

 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')
 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/*.*'))

doc/man/cover.jpg

Added
New image
+/* 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;
+}
+<?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> 
 set       toc,title
 </xsl:param>
 
+<!-- Prevent our EPUB cover image from getting included -->
+<xsl:template match="mediaobject[@role = 'cover']">
+</xsl:template>
+
 </xsl:stylesheet> 
 
   <xsl:apply-templates select="." mode="vl.as.blocks"/>
 </xsl:template>
 
+<!-- Prevent our EPUB cover image from getting printed to the PDF -->
+<xsl:template match="mediaobject[@role = 'cover']">
+</xsl:template>
+
 </xsl:stylesheet> 
-

doc/man/scons.xml

     </copyright>
 
     <releaseinfo>version &buildversion;</releaseinfo>
+    
+    <mediaobject role="cover"><imageobject><imagedata fileref="cover.jpg" format="JPG"/></imageobject></mediaobject>
+    
   </referenceinfo>
 
   <title>SCons &buildversion;</title>

doc/user/MANIFEST

 variables.xml
 *.jpg
 *.xsl
-scons.css
+*.css
 SConstruct
 titlepage/bricks.jpg
 titlepage/mapnik_final_colors.svg

doc/user/SConstruct

 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_HTMLCHUNKED='chtml.xsl',
 env.DocbookHtmlChunked('index.html', 'scons_db.xml', base_dir='scons-user/')
 if has_pdf:
     env.DocbookPdf('scons-user.pdf','scons_db.xml')
+
+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-user.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-user.epub', 'OEBPS', ZIPFLAGS='-Xr9D')
+    env.Clean(oebps, Glob('OEBPS/*.*'))
+    env.Clean(oebps, Glob('META-INF/*.*'))

doc/user/chtml.xsl

 set       toc,title
 </xsl:param>
 
+<!-- Prevent our EPUB cover image from getting included -->
+<xsl:template match="mediaobject[@role = 'cover']">
+</xsl:template>
+
 </xsl:stylesheet> 
 

doc/user/cover.jpg

Added
New image

doc/user/epub.css

+/* 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;
+}

doc/user/epub.xsl

+<?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> 
+

doc/user/html.xsl

 set       toc,title
 </xsl:param>
 
+<!-- Prevent our EPUB cover image from getting included -->
+<xsl:template match="mediaobject[@role = 'cover']">
+</xsl:template>
+
 </xsl:stylesheet> 
 

doc/user/main.xml

     
     <releaseinfo>version &buildversion;</releaseinfo>
 
+    <mediaobject role="cover"><imageobject><imagedata fileref="cover.jpg" format="JPG"/></imageobject></mediaobject>
   </bookinfo>
 
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="preface.xml"/>
   <xsl:apply-templates select="." mode="vl.as.blocks"/>
 </xsl:template>
 
+<!-- Prevent our EPUB cover image from getting printed to the PDF -->
+<xsl:template match="mediaobject[@role = 'cover']">
+</xsl:template>
+
 </xsl:stylesheet> 
 

doc/xsd/dbpoolx.xsd

         </xs:documentation>
       </xs:annotation>
       <xs:choice minOccurs="0" maxOccurs="unbounded">
-        <xs:group ref="para.char.mix"/>
         <xs:group ref="para.mix"/>
         <xs:group ref="tool.mix"/>
       </xs:choice>
         </xs:documentation>
       </xs:annotation>
       <xs:choice minOccurs="0" maxOccurs="unbounded">
-        <xs:group ref="para.char.mix"/>
         <xs:group ref="para.mix"/>
         <xs:group ref="tool.mix"/>
       </xs:choice>
         </xs:documentation>
       </xs:annotation>
       <xs:choice minOccurs="0" maxOccurs="unbounded">
-        <xs:group ref="para.char.mix"/>
         <xs:group ref="para.mix"/>
         <xs:element ref="summary"/>
       </xs:choice>

src/engine/SCons/Tool/gs.py

 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import SCons.Action
+import SCons.Builder
 import SCons.Platform
 import SCons.Util
 
 def generate(env):
     """Add Builders and construction variables for Ghostscript to an
     Environment."""
+    global GhostscriptAction
+    # The following try-except block enables us to use the Tool
+    # in standalone mode (without the accompanying pdf.py),
+    # whenever we need an explicit call of gs via the Gs()
+    # Builder ...
+    try:
+        if GhostscriptAction is None:
+            GhostscriptAction = SCons.Action.Action('$GSCOM', '$GSCOMSTR')
+    
+        import pdf
+        pdf.generate(env)
+    
+        bld = env['BUILDERS']['PDF']
+        bld.add_action('.ps', GhostscriptAction)
+    except ImportError, e:
+        pass
 
-    global GhostscriptAction
-    if GhostscriptAction is None:
-        GhostscriptAction = SCons.Action.Action('$GSCOM', '$GSCOMSTR')
-
-    import pdf
-    pdf.generate(env)
-
-    bld = env['BUILDERS']['PDF']
-    bld.add_action('.ps', GhostscriptAction)
-
+    gsbuilder = SCons.Builder.Builder(action = SCons.Action.Action('$GSCOM', '$GSCOMSTR'),
+                                      env = env)
+    env['BUILDERS']['Gs'] = gsbuilder
+    
     env['GS']      = gs
     env['GSFLAGS'] = SCons.Util.CLVar('-dNOPAUSE -dBATCH -sDEVICE=pdfwrite')
     env['GSCOM']   = '$GS $GSFLAGS -sOutputFile=$TARGET $SOURCES'

src/engine/SCons/Tool/gs.xml

 <tool name="gs">
 <summary>
 <para>
-Set construction variables for Ghostscript.
+This Tool sets the required construction variables for working with
+the Ghostscript command. It also registers an appropriate Action
+with the PDF Builder (&b-link-PDF;), such that the conversion from
+PS/EPS to PDF happens automatically for the TeX/LaTeX toolchain.
+Finally, it adds an explicit Ghostscript Builder (&b-link-Gs;) to the
+environment.
 </para>
 </summary>
 <sets>
 <cvar name="GS">
 <summary>
 <para>
-The Ghostscript program used to convert PostScript to PDF files.
+The Ghostscript program used, e.g. to convert PostScript to PDF files.
 </para>
 </summary>
 </cvar>
 <cvar name="GSCOM">
 <summary>
 <para>
-The Ghostscript command line used to convert PostScript to PDF files.
+The full Ghostscript command line used for the conversion process. Its default
+value is <quote><literal>$GS $GSFLAGS -sOutputFile=$TARGET $SOURCES</literal></quote>.
 </para>
 </summary>
 </cvar>
 <summary>
 <para>
 The string displayed when
-Ghostscript is used to convert
-a PostScript file to a PDF file.
-If this is not set, then &cv-link-GSCOM; (the command line) is displayed.
+Ghostscript is called for the conversion process.
+If this is not set (the default), then &cv-link-GSCOM; (the command line) is displayed.
 </para>
 </summary>
 </cvar>
 <cvar name="GSFLAGS">
 <summary>
 <para>
-General options passed to the Ghostscript program
-when converting PostScript to PDF files.
+General options passed to the Ghostscript program,
+when converting PostScript to PDF files for example. Its default value
+is <quote><literal>-dNOPAUSE -dBATCH -sDEVICE=pdfwrite</literal></quote>
 </para>
 </summary>
 </cvar>
 
+<builder name="Gs">
+<summary>
+<para>
+A Builder for explicitly calling the <literal>gs</literal> executable.
+Depending on the underlying OS, the different names <literal>gs</literal>,
+<literal>gsos2</literal> and <literal>gswin32c</literal>
+are tried.
+</para>
+<example_commands>env = Environment(tools=['gs'])
+env.Gs('cover.jpg','scons-scons.pdf',
+       GSFLAGS='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -q') 
+       )
+</example_commands>
+</summary>
+</builder>
+
 </sconsdoc>

src/engine/SCons/Tool/msginit.xml

 Internal ``macro''. Computes locale (language) name based on target filename
 (default: <literal>'${TARGET.filebase}' </literal>).
 </para>
+<para>
+See &t-link-msginit; tool and &b-link-POInit; builder.
+</para>
 </summary>
-See &t-link-msginit; tool and &b-link-POInit; builder.
 </cvar>
 
 </sconsdoc>

test/Ghostscript/GS.py

                   GSCOM = r'$GS $TARGET $SOURCE',
                   tools=['gs'])
 env.PDF(target = 'test1.pdf', source = 'test1.ps')
+env.Gs(target = 'test2.pdf', source = 'test1.ps')
 """ % locals())
 
 test.write('test1.ps', r"""This is a .ps test.
 test.run(arguments = '.', stderr = None)
 
 test.fail_test(test.read('test1.pdf') != "This is a .ps test.\n")
+test.fail_test(test.read('test2.pdf') != "This is a .ps test.\n")