[SCons] Add option to skip running Sphinx Gallery examples

This commit is contained in:
Ray Speth
2024-06-03 23:26:46 -04:00
committed by Ray Speth
parent 47e7c1a2de
commit 98b8fa63cc
2 changed files with 8 additions and 0 deletions
+6
View File
@@ -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.",
+2
View File
@@ -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',