1313
1414import re
1515import sys
16+ import os
1617
1718sys.path.insert(0, "{{sphinx_docs_target}}")
1819
@@ -28,7 +29,7 @@ master_doc = "index"
2829# The short X.Y version
2930version = "{{version}}"
3031release = "{{release}}"
31-
32+ master_doc = "index"
3233
3334# -- General configuration ---------------------------------------------------
3435
@@ -72,6 +73,8 @@ source_suffix = {
7273 ".md": "myst-nb",
7374}
7475
76+ # If you want to mock imports during autodoc
77+ autodoc_mock_imports = [{{mock_imports}}]
7578
7679# -- Options for HTML output -------------------------------------------------
7780
@@ -86,22 +89,33 @@ html_theme = "sphinx_book_theme"
8689html_static_path = ["_static"]
8790html_css_files = ["css/custom.css"]
8891
92+ # conf.py
93+
94+ html_context = {
95+ "default_mode": "light", # Enforces light mode on page load
96+ }
97+
8998html_theme_options = {
9099 "repository_url": "{{repository_url}}",
91- "use_repository_button": True,
92- "use_issues_button": True,
93- "use_edit_page_button": True,
100+ "repository_branch": "{{repository_branch}}",
101+ "path_to_docs": "docs",
94102 "use_repository_button": False,
95103 "use_issues_button": False,
96104 "use_edit_page_button": False,
97- "path_to_docs": "docs",
98- "repository_branch": "{{repository_branch}}",
99- "single_page": True,
105+ "home_page_in_toc": False,
100106 "navigation_with_keys": False,
101- "use_download_button": False,
102107 "use_fullscreen_button": False,
108+ "show_navbar_depth": 1,
109+ "theme_dev_mode": False,
110+ "launch_buttons": {},
111+ "switcher": False,
112+ "search_bar_text": "",
113+ "search_bar_position": "none",
103114}
104115
116+ # Prevents generation of searchindex.js
117+ html_search = False
118+
105119html_title = "{{html_title}}"
106120html_logo = "{{html_logo}}"
107121html_favicon = "{{html_favicon}}"
@@ -124,3 +138,12 @@ def copy_doc(src, dest, title=""):
124138 changed = True
125139 out.write(line)
126140{% endraw %}
141+
142+ # -- Post-build cleanup ------------------------------------------------------
143+ def remove_searchtools(app, exception):
144+ searchtools_path = os.path.join(app.outdir, '_static', 'searchtools.js')
145+ if os.path.exists(searchtools_path):
146+ os.remove(searchtools_path)
147+
148+ def setup(app):
149+ app.connect("build-finished", remove_searchtools)
0 commit comments