Skip to content

Commit f84c4eb

Browse files
authored
sphinx-rtd-theme will automatically enable sphinxcontrib-jquery (#1399)
1 parent 0763576 commit f84c4eb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sphinx_rtd_theme/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ def setup(app):
5050
if app.config.html4_writer:
5151
logger.warning("'html4_writer' is deprecated with sphinx_rtd_theme")
5252

53+
# Since Sphinx 6, jquery isn't bundled anymore and we need to ensure that
54+
# the sphinxcontrib-jquery extension is enabled.
55+
# See: https://dev.readthedocs.io/en/latest/design/sphinx-jquery.html
56+
if sphinx_version >= (6, 0, 0):
57+
# Documentation of Sphinx guarantees that an extension is added and
58+
# enabled at most once.
59+
# See: https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.setup_extension
60+
app.setup_extension("sphinxcontrib.jquery")
61+
5362
# Register the theme that can be referenced without adding a theme path
5463
app.add_html_theme('sphinx_rtd_theme', path.abspath(path.dirname(__file__)))
5564

0 commit comments

Comments
 (0)