mirror of
https://github.com/Cantera/cantera.git
synced 2026-08-09 12:38:22 -05:00
[SCons] Add option to skip running Sphinx Gallery examples
This commit is contained in:
@@ -308,6 +308,12 @@ config_options = [
|
||||
"sphinx_docs",
|
||||
"Build HTML documentation for Cantera using Sphinx.",
|
||||
False),
|
||||
BoolOption(
|
||||
"run_examples",
|
||||
"""Run examples to generate plots and outputs for Sphinx Gallery. Disable to
|
||||
speed up doc builds when not working on the examples or if dependencies of
|
||||
the examples are not available.""",
|
||||
True),
|
||||
PathOption(
|
||||
"sphinx_cmd",
|
||||
"Command to use for building the Sphinx documentation.",
|
||||
|
||||
@@ -34,6 +34,8 @@ if localenv['sphinx_docs']:
|
||||
localenv.PrependENVPath('PYTHONPATH', Dir('#build/python').abspath)
|
||||
def build_sphinx(target, source, env):
|
||||
cmd = [env['sphinx_cmd']] + env['sphinx_options'].split()
|
||||
if not env['run_examples']:
|
||||
cmd.extend(('-D', 'plot_gallery=0'))
|
||||
if env['logging'] == 'debug':
|
||||
cmd.append('-v')
|
||||
cmd += ('-b', 'html', '-d', 'build/doc/sphinx/doctrees', 'build/doc/sphinx',
|
||||
|
||||
Reference in New Issue
Block a user