diff options
author | Chris Johns <chrisj@rtems.org> | 2017-03-21 08:41:41 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2017-03-21 08:41:41 +1100 |
commit | 228560fdf2773675c725f5aacd6ce51ba36cfce3 (patch) | |
tree | 45a66c52106ceb22f50bbfb7135d316d2bc46c33 | |
parent | Use a single top level version number. (diff) | |
download | rtems-docs-228560fdf2773675c725f5aacd6ce51ba36cfce3.tar.bz2 |
waf: Create the sphinx rule in one place.
-rw-r--r-- | common/waf.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/common/waf.py b/common/waf.py index dbd70df..ad7900b 100644 --- a/common/waf.py +++ b/common/waf.py @@ -228,13 +228,17 @@ def cmd_configure(ctx): ctx.fatal("Node inliner is required install with 'npm install -g inliner' " + "(https://github.com/remy/inliner)") +def sphinx_cmdline(ctx, build_type, conf_dir, doctrees, source_dir, output_dir): + rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s %s -d %s %s %s" % \ + (sphinx_verbose(ctx), build_type, conf_dir, version_cmdline(ctx), + doctrees, source_dir, output_dir) + return rule + def doc_pdf(ctx, source_dir, conf_dir): buildtype = 'latex' build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype) pdf_resources(ctx, buildtype) - rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s %s -d %s %s %s" % \ - (sphinx_verbose(ctx), buildtype, conf_dir, version_cmdline(ctx), - doctrees, source_dir, output_dir) + rule = sphinx_cmdline(ctx, buildtype, conf_dir, doctrees, source_dir, output_dir) ctx( rule = rule, cwd = ctx.path, @@ -284,9 +288,7 @@ def doc_singlehtml(ctx, source_dir, conf_dir): buildtype = 'singlehtml' build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype) html_resources(ctx, buildtype) - rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s %s -d %s %s %s" % \ - (sphinx_verbose(ctx), buildtype, conf_dir, version_cmdline(ctx), - doctrees, source_dir, output_dir) + rule = sphinx_cmdline(ctx, buildtype, conf_dir, doctrees, source_dir, output_dir) ctx( rule = rule, cwd = ctx.path, @@ -306,9 +308,7 @@ def doc_html(ctx, conf_dir, source_dir): buildtype = 'html' build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype) html_resources(ctx, buildtype) - rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s %s -d %s %s %s" % \ - (sphinx_verbose(ctx), buildtype, conf_dir, version_cmdline(ctx), - doctrees, source_dir, output_dir) + rule = sphinx_cmdline(ctx, buildtype, conf_dir, doctrees, source_dir, output_dir) ctx( rule = rule, cwd = ctx.path, @@ -343,11 +343,11 @@ def cmd_options(ctx): default = "-Q", help = "Sphinx verbose.") ctx.add_option('--pdf', - action='store_true', + action = 'store_true', default = False, help = "Build PDF.") ctx.add_option('--singlehtml', - action='store_true', + action = 'store_true', default = False, help = "Build Single HTML file, requires Node Inliner") |