|
19 | 19 | importsys |
20 | 20 | fromurllib.parseimporturlsplit,urlunsplit |
21 | 21 | importwarnings |
| 22 | + |
| 23 | +importsphinx |
22 | 24 | importyaml |
23 | 25 |
|
24 | 26 | importmatplotlib |
@@ -408,6 +410,9 @@ def add_html_cache_busting(app, pagename, templatename, context, doctree): |
408 | 410 | This adds the Matplotlib version as a query to the link reference in the |
409 | 411 | HTML, if the path is not absolute (i.e., it comes from the `_static` |
410 | 412 | 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. |
411 | 416 | """ |
412 | 417 | fromsphinx.builders.htmlimportStylesheet,JavaScript |
413 | 418 |
|
@@ -785,4 +790,5 @@ def setup(app): |
785 | 790 | bld_type='rel' |
786 | 791 | app.add_config_value('skip_sub_dirs',0,'') |
787 | 792 | app.add_config_value('releaselevel',bld_type,'env') |
788 | | -app.connect('html-page-context',add_html_cache_busting,priority=1000) |
| 793 | +ifsphinx.version_info[:2]< (7,1): |
| 794 | +app.connect('html-page-context',add_html_cache_busting,priority=1000) |