|
1 | 1 | import os |
| 2 | +import sys |
2 | 3 | from glob import glob |
3 | 4 | from datetime import datetime |
4 | 5 |
|
|
75 | 76 | extensions = [ |
76 | 77 | "enum_tools.autoenum", |
77 | 78 | "nbsphinx", |
78 | | - "pydata_sphinx_theme", |
79 | 79 | "sphinx.ext.autosectionlabel", |
80 | 80 | "sphinx.ext.autodoc", |
81 | 81 | "sphinx.ext.graphviz", |
|
91 | 91 | typehints_defaults = "comma" |
92 | 92 | typehints_use_signature = True |
93 | 93 | simplify_optional_unions = False |
| 94 | +suppress_warnings = ['autosectionlabel.*'] |
94 | 95 |
|
95 | 96 | # Intersphinx mapping |
96 | 97 | intersphinx_mapping = { |
@@ -200,7 +201,6 @@ def reset_servers(gallery_conf, fname, when): |
200 | 201 | "json_url": f"https://{cname}/versions.json", |
201 | 202 | "version_match": get_version_match(__version__), |
202 | 203 | }, |
203 | | - "navbar_end": ["version-switcher", "theme-switcher", "navbar-icon-links"], |
204 | 204 | "use_meilisearch": { |
205 | 205 | "api_key": os.getenv("MEILISEARCH_PUBLIC_API_KEY", ""), |
206 | 206 | "index_uids": { |
@@ -313,3 +313,13 @@ def reset_servers(gallery_conf, fname, when): |
313 | 313 |
|
314 | 314 | # A list of files that should not be packed into the epub file. |
315 | 315 | epub_exclude_files = ["search.html"] |
| 316 | + |
| 317 | + |
| 318 | +def verify_meilisearch_is_active(app): |
| 319 | + MEILISEARCH_PUBLIC_API_KEY = os.getenv("MEILISEARCH_PUBLIC_API_KEY", None) |
| 320 | + if not MEILISEARCH_PUBLIC_API_KEY: |
| 321 | + sys.stderr.write("Could not find MEILISEARCH_PUBLIC_API_KEY") |
| 322 | + sys.exit(1) |
| 323 | + |
| 324 | +def setup(app): |
| 325 | + app.connect("builder-inited", verify_meilisearch_is_active) |
0 commit comments