File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44from pathlib import Path
55from typing import Any , Dict , List
66
7- import sphinx
87import sphinx .application
98from sphinx .builders .html import StandaloneHTMLBuilder
109
@@ -21,11 +20,6 @@ def _asset_hash(path: str) -> str:
2120
2221
2322def _add_asset_hashes (static : List [str ], add_digest_to : List [str ]) -> None :
24- if sphinx .version_info >= (7 , 1 ):
25- # https://github.com/sphinx-doc/sphinx/pull/11415 added the relevant
26- # functionality to Sphinx, so we don't need to do anything.
27- return
28-
2923 for asset in add_digest_to :
3024 index = static .index (asset )
3125 static [index ].filename = _asset_hash (asset ) # type: ignore
@@ -43,7 +37,7 @@ def _html_page_context(
4337
4438 assert isinstance (app .builder , StandaloneHTMLBuilder )
4539
46- if sphinx .version_info >= ( 4 , ) and "css_files" in context :
40+ if ( 4 ,) <= sphinx .version_info < ( 7 , 1 ) and "css_files" in context :
4741 if "_static/pydoctheme.css" not in context ["css_files" ]:
4842 raise ValueError (
4943 "This documentation is not using `pydoctheme.css` as the stylesheet. "
You can’t perform that action at this time.
0 commit comments