Skip to content

Commit

Permalink
Use sphinx-remove-toctree
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Arellano committed Jul 26, 2023
1 parent 2968e8b commit f9da86b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
21 changes: 18 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

"""Sphinx documentation builder."""

# -- General configuration ---------------------------------------------------
import datetime
import doctest
import os

project = "Qiskit"
copyright = f"2017-{datetime.date.today().year}, Qiskit Development Team" # pylint: disable=redefined-builtin
project_copyright = f"2017-{datetime.date.today().year}, Qiskit Development Team"
author = "Qiskit Development Team"

# The short X.Y version
Expand All @@ -37,8 +37,8 @@
"sphinx.ext.doctest",
"reno.sphinxext",
"sphinx_design",
"sphinx_remove_toctrees",
"matplotlib.sphinxext.plot_directive",
"sphinx.ext.doctest",
"qiskit_sphinx_theme",
]

Expand Down Expand Up @@ -72,6 +72,11 @@
"matplotlib": ("https://matplotlib.org/stable/", None),
}

# This speeds up the docs build because it works around the Furo theme's slowdown from the left
# sidebar when the site has lots of HTML pages. But, it results in a much worse user experience,
# so we only use it in dev/CI builds.
remove_from_toctrees = ["stubs/*"]

# -- Options for HTML output -------------------------------------------------

html_theme = "qiskit"
Expand Down Expand Up @@ -127,3 +132,13 @@
# >> code
# output
doctest_test_doctest_blocks = ""

# ---------------------------------------------------------------------------------------
# Prod changes
# ---------------------------------------------------------------------------------------

if os.getenv("DOCS_PROD_BUILD"):
# `viewcode` down the Furo-based theme by about 14 minutes.
extensions.append("sphinx.ext.viewcode")
# Include all pages in the left sidebar in prod.
remove_from_toctrees = []
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ seaborn>=0.9.0
reno @ git+https://github.com/openstack/reno.git@81587f616f17904336cdc431e25c42b46cd75b8f
Sphinx>=5.0
qiskit-sphinx-theme~=1.14.0
sphinx-remove-toctrees
sphinx-design>=0.2.0
pygments>=2.4
scikit-learn>=0.20.0
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ setenv =
{[testenv]setenv}
QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y
RUST_DEBUG=1 # Faster to compile.
passenv =
DOCS_PROD_BUILD
deps =
setuptools_rust # This is work around for the bug of tox 3 (see #8606 for more details.)
-r{toxinidir}/requirements-dev.txt
Expand Down

0 comments on commit f9da86b

Please sign in to comment.