1 # SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
2 # SPDX-License-Identifier: MIT
5 SConstruct file for building SCons User Guide..
7 This is usually invoked as a separate build by the top-level SCons build.
9 If invoked directly, can add SKIP_PDF=1 to avoid pdf and epub generation.
15 ENV
={'PATH': os
.environ
['PATH']},
16 tools
=['docbook', 'gs', 'zip'],
17 toolpath
=['../../SCons/Tool'],
18 # DOCBOOK_XSLTPROCFLAGS="--stringparam fop.extensions 1",
19 DOCBOOK_DEFAULT_XSL_HTML
='html.xsl',
20 DOCBOOK_DEFAULT_XSL_HTMLCHUNKED
='chtml.xsl',
21 DOCBOOK_DEFAULT_XSL_PDF
='pdf.xsl',
24 skip_pdf
= ARGUMENTS
.get('SKIP_PDF', False)
26 if not skip_pdf
and any((env
.WhereIs('fop'), env
.WhereIs('xep'))):
32 env
.DocbookXInclude('scons_xi.xml', 'main.xml')
33 env
.DocbookXslt('scons_ex.xml', 'scons_xi.xml', xsl
='../xslt/xinclude_examples.xslt')
34 env
.DocbookXInclude('scons_exi.xml', 'scons_ex.xml')
35 env
.DocbookXslt('scons_db.xml', 'scons_exi.xml', xsl
='../xslt/to_docbook.xslt')
36 env
.DocbookHtml('index.html', 'scons_db.xml')
37 env
.DocbookHtmlChunked('index.html', 'scons_db.xml', base_dir
='scons-user/')
39 env
.DocbookPdf('scons-user.pdf', 'scons_db.xml')
46 # Create the EPUB format
48 if has_gs
and has_pdf
:
52 GSFLAGS
='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -dJPEGQ=100 -r72x72 -q',
54 epub
= env
.DocbookEpub('scons-user.epub', 'scons_db.xml', xsl
='epub.xsl')
55 env
.Depends(epub
, jpg
)