Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sphinx-rtd-theme will automatically enable sphinxcontrib-jquery #1399

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions sphinx_rtd_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ def setup(app):
if app.config.html4_writer:
logger.warning("'html4_writer' is deprecated with sphinx_rtd_theme")

# Since Sphinx 6, jquery isn't bundled anymore and we need to ensure that
# the sphinxcontrib-jquery extension is enabled.
# See: https://dev.readthedocs.io/en/latest/design/sphinx-jquery.html
if sphinx_version >= (6, 0, 0):
# Documentation of Sphinx guarantees that an extension is added and
# enabled at most once.
# See: https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.setup_extension
app.setup_extension("sphinxcontrib.jquery")

# Register the theme that can be referenced without adding a theme path
app.add_html_theme('sphinx_rtd_theme', path.abspath(path.dirname(__file__)))

Expand Down