Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 48e2891

Browse files
authored
Merge pull request matplotlib#26493 from AA-Turner/sphinx-7-1-checksums
Disable ``add_html_cache_busting`` on Sphinx 7.1+
2 parents eb5ae31 + a01fbae commit 48e2891

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

doc/conf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import sys
2020
from urllib.parse import urlsplit, urlunsplit
2121
import warnings
22+
23+
import sphinx
2224
import yaml
2325

2426
import matplotlib
@@ -408,6 +410,9 @@ def add_html_cache_busting(app, pagename, templatename, context, doctree):
408410
This adds the Matplotlib version as a query to the link reference in the
409411
HTML, if the path is not absolute (i.e., it comes from the `_static`
410412
directory) and doesn't already have a query.
413+
414+
.. note:: Sphinx 7.1 provides asset checksums; so this hook only runs on
415+
Sphinx 7.0 and earlier.
411416
"""
412417
from sphinx.builders.html import Stylesheet, JavaScript
413418

@@ -785,4 +790,5 @@ def setup(app):
785790
bld_type = 'rel'
786791
app.add_config_value('skip_sub_dirs', 0, '')
787792
app.add_config_value('releaselevel', bld_type, 'env')
788-
app.connect('html-page-context', add_html_cache_busting, priority=1000)
793+
if sphinx.version_info[:2] < (7, 1):
794+
app.connect('html-page-context', add_html_cache_busting, priority=1000)

0 commit comments

Comments
 (0)