mirror of
https://git.rtems.org/rtems-docs/
synced 2025-07-24 02:12:07 +08:00
waf: Create the sphinx rule in one place.
This commit is contained in:
parent
f97be09daf
commit
228560fdf2
@ -228,13 +228,17 @@ def cmd_configure(ctx):
|
|||||||
ctx.fatal("Node inliner is required install with 'npm install -g inliner' " +
|
ctx.fatal("Node inliner is required install with 'npm install -g inliner' " +
|
||||||
"(https://github.com/remy/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):
|
def doc_pdf(ctx, source_dir, conf_dir):
|
||||||
buildtype = 'latex'
|
buildtype = 'latex'
|
||||||
build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype)
|
build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype)
|
||||||
pdf_resources(ctx, buildtype)
|
pdf_resources(ctx, buildtype)
|
||||||
rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s %s -d %s %s %s" % \
|
rule = sphinx_cmdline(ctx, buildtype, conf_dir, doctrees, source_dir, output_dir)
|
||||||
(sphinx_verbose(ctx), buildtype, conf_dir, version_cmdline(ctx),
|
|
||||||
doctrees, source_dir, output_dir)
|
|
||||||
ctx(
|
ctx(
|
||||||
rule = rule,
|
rule = rule,
|
||||||
cwd = ctx.path,
|
cwd = ctx.path,
|
||||||
@ -284,9 +288,7 @@ def doc_singlehtml(ctx, source_dir, conf_dir):
|
|||||||
buildtype = 'singlehtml'
|
buildtype = 'singlehtml'
|
||||||
build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype)
|
build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype)
|
||||||
html_resources(ctx, buildtype)
|
html_resources(ctx, buildtype)
|
||||||
rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s %s -d %s %s %s" % \
|
rule = sphinx_cmdline(ctx, buildtype, conf_dir, doctrees, source_dir, output_dir)
|
||||||
(sphinx_verbose(ctx), buildtype, conf_dir, version_cmdline(ctx),
|
|
||||||
doctrees, source_dir, output_dir)
|
|
||||||
ctx(
|
ctx(
|
||||||
rule = rule,
|
rule = rule,
|
||||||
cwd = ctx.path,
|
cwd = ctx.path,
|
||||||
@ -306,9 +308,7 @@ def doc_html(ctx, conf_dir, source_dir):
|
|||||||
buildtype = 'html'
|
buildtype = 'html'
|
||||||
build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype)
|
build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype)
|
||||||
html_resources(ctx, buildtype)
|
html_resources(ctx, buildtype)
|
||||||
rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s %s -d %s %s %s" % \
|
rule = sphinx_cmdline(ctx, buildtype, conf_dir, doctrees, source_dir, output_dir)
|
||||||
(sphinx_verbose(ctx), buildtype, conf_dir, version_cmdline(ctx),
|
|
||||||
doctrees, source_dir, output_dir)
|
|
||||||
ctx(
|
ctx(
|
||||||
rule = rule,
|
rule = rule,
|
||||||
cwd = ctx.path,
|
cwd = ctx.path,
|
||||||
@ -343,11 +343,11 @@ def cmd_options(ctx):
|
|||||||
default = "-Q",
|
default = "-Q",
|
||||||
help = "Sphinx verbose.")
|
help = "Sphinx verbose.")
|
||||||
ctx.add_option('--pdf',
|
ctx.add_option('--pdf',
|
||||||
action='store_true',
|
action = 'store_true',
|
||||||
default = False,
|
default = False,
|
||||||
help = "Build PDF.")
|
help = "Build PDF.")
|
||||||
ctx.add_option('--singlehtml',
|
ctx.add_option('--singlehtml',
|
||||||
action='store_true',
|
action = 'store_true',
|
||||||
default = False,
|
default = False,
|
||||||
help = "Build Single HTML file, requires Node Inliner")
|
help = "Build Single HTML file, requires Node Inliner")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user