diff options
author | Dirk Baechle <dl9obn@darc.de> | 2013-10-08 13:45:37 (GMT) |
---|---|---|
committer | Dirk Baechle <dl9obn@darc.de> | 2013-10-08 13:45:37 (GMT) |
commit | ef9d8a0031b3ca6faabb0746eeb2a7da519fb805 (patch) | |
tree | f2822fcfebe6b8257b5d1fe2e74af24b5885e82d /doc/user/SConstruct | |
parent | 3bebac3d0e8f24065ecda4abb2a2dad7b1d57164 (diff) | |
download | SCons-ef9d8a0031b3ca6faabb0746eeb2a7da519fb805.zip SCons-ef9d8a0031b3ca6faabb0746eeb2a7da519fb805.tar.gz SCons-ef9d8a0031b3ca6faabb0746eeb2a7da519fb805.tar.bz2 |
- added EPUB as output format for documentation ("user" and "man" targets)
Diffstat (limited to 'doc/user/SConstruct')
-rw-r--r-- | doc/user/SConstruct | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/doc/user/SConstruct b/doc/user/SConstruct index 002aea4..5d36a5e 100644 --- a/doc/user/SConstruct +++ b/doc/user/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_HTMLCHUNKED='chtml.xsl', @@ -51,3 +51,23 @@ env.DocbookHtml('index.html','scons_db.xml') 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/*.*')) |