|
28 | 28 | # The full version, including alpha/beta/rc tags |
29 | 29 | release = "0.45.0" |
30 | 30 |
|
31 | | -# The language for content autogenerated by Sphinx or the default for gettext content translation. |
32 | 31 | language = "en" |
33 | 32 |
|
34 | | -# For 'qiskit_sphinx_theme' tells it we're based at 'https://qiskit.org/<docs_url_prefix>'. |
| 33 | +# This tells 'qiskit_sphinx_theme' that we're based at 'https://qiskit.org/<docs_url_prefix>'. |
35 | 34 | # Should not include the subdirectory for the stable version. |
36 | 35 | docs_url_prefix = "documentation" |
37 | 36 |
|
|
42 | 41 | "sphinx.ext.autodoc", |
43 | 42 | "sphinx.ext.autosummary", |
44 | 43 | "sphinx.ext.mathjax", |
45 | | - "sphinx.ext.viewcode", |
46 | 44 | "sphinx.ext.extlinks", |
47 | 45 | "sphinx.ext.intersphinx", |
48 | 46 | "sphinx.ext.doctest", |
49 | | - "reno.sphinxext", |
50 | | - "sphinx_design", |
| 47 | + "nbsphinx", |
51 | 48 | "matplotlib.sphinxext.plot_directive", |
52 | 49 | "qiskit_sphinx_theme", |
53 | | - "nbsphinx", |
| 50 | + "reno.sphinxext", |
| 51 | + "sphinx_design", |
| 52 | + "sphinx_remove_toctrees", |
54 | 53 | ] |
55 | 54 |
|
56 | 55 | templates_path = ["_templates"] |
|
132 | 131 | } # enable segment analytics for qiskit.org/documentation |
133 | 132 | html_static_path = ["_static"] |
134 | 133 |
|
| 134 | +# This speeds up the docs build because it works around the Furo theme's slowdown from the left |
| 135 | +# sidebar when the site has lots of HTML pages. But, it results in a much worse user experience, |
| 136 | +# so we only use it in dev/CI builds. |
| 137 | +remove_from_toctrees = ["stubs/*"] |
| 138 | + |
135 | 139 | # ---------------------------------------------------------------------------------- |
136 | 140 | # Autodoc |
137 | 141 | # ---------------------------------------------------------------------------------- |
|
225 | 229 |
|
226 | 230 | """ |
227 | 231 |
|
| 232 | +# --------------------------------------------------------------------------------------- |
| 233 | +# Prod changes |
| 234 | +# --------------------------------------------------------------------------------------- |
| 235 | + |
| 236 | +if os.getenv("DOCS_PROD_BUILD"): |
| 237 | + # `viewcode` slows down docs build by about 14 minutes. |
| 238 | + extensions.append("sphinx.ext.viewcode") |
| 239 | + # Include all pages in the left sidebar in prod. |
| 240 | + remove_from_toctrees = [] |
| 241 | + |
| 242 | + |
| 243 | +# --------------------------------------------------------------------------------------- |
| 244 | +# Custom extensions |
| 245 | +# --------------------------------------------------------------------------------------- |
228 | 246 |
|
229 | 247 | def add_versions_to_config(_app, config): |
230 | 248 | """Add a list of old documentation versions that should have links generated to them into the |
|
0 commit comments