Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc7958da

Browse files
authored
Rework based on suggested changes
Sphinx 7.1 added the relevant functionality natively.
1 parentef296e2 commitc7958da

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

‎python_docs_theme/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
frompathlibimportPath
55
fromtypingimportAny,Dict,List
66

7-
importsphinx
87
importsphinx.application
98
fromsphinx.builders.htmlimportStandaloneHTMLBuilder
109

@@ -21,11 +20,6 @@ def _asset_hash(path: str) -> str:
2120

2221

2322
def_add_asset_hashes(static:List[str],add_digest_to:List[str])->None:
24-
ifsphinx.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
forassetinadd_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
assertisinstance(app.builder,StandaloneHTMLBuilder)
4539

46-
ifsphinx.version_info>= (4,)and"css_files"incontext:
40+
if(4,)<=sphinx.version_info< (7,1)and"css_files"incontext:
4741
if"_static/pydoctheme.css"notincontext["css_files"]:
4842
raiseValueError(
4943
"This documentation is not using `pydoctheme.css` as the stylesheet. "

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp