[Doc] Make Sphinx search work when hosting docs locally

The javascript for the search box wouldn't work due to an earlier
error in the javascript for the version switcher when the switcher
JSON file couldn't be loaded.
This commit is contained in:
Ray Speth
2024-06-12 14:08:41 -04:00
committed by Ray Speth
parent ded4513c8b
commit 6e170b3187
2 changed files with 5 additions and 2 deletions

View File

@@ -54,10 +54,14 @@ if localenv['sphinx_docs']:
"#CONTRIBUTING.md",
Copy("$TARGET", "$SOURCE"))
copy_switcher = localenv.Command("#build/doc/html/dev/_static/doc-versions.json",
"sphinx/_static/doc-versions.json",
Copy("$TARGET", "$SOURCE"))
sphinxdocs = build(localenv.Command('#build/doc/html/index.html',
'sphinx/conf.py', build_sphinx))
env.Alias('sphinx', sphinxdocs)
env.Depends(sphinxdocs, [copy_sphinx, copy_contrib])
env.Depends(sphinxdocs, [copy_sphinx, copy_contrib, copy_switcher])
env.Depends(sphinxdocs, [copy_python_samples, copy_matlab_ex_samples])
env.Depends(sphinxdocs, env['python_module'])

View File

@@ -325,7 +325,6 @@ html_theme_options = {
"primary_sidebar_end": ["numfocus"],
"switcher": {
"json_url": "/dev/_static/doc-versions.json",
# "json_url": "https://cantera.org/doc-versions.json",
"version_match": version,
},
"check_switcher": False,