File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -77,17 +77,15 @@ def test_search(value: str, pattern: str) -> bool:
77
77
78
78
rtd_links_prefix = PurePosixPath ("src" )
79
79
80
- rtd_ver = os . environ . get ( "READTHEDOCS_VERSION" , "" )
81
- if re .fullmatch (r"\d+" , rtd_ver ): # PR versions don’t have a own search index
80
+ # PR versions don’t have a own search index
81
+ if re .fullmatch (r"\d+" , os . environ . get ( "READTHEDOCS_VERSION" , "" )):
82
82
rtd_sphinx_search_default_filter = (
83
83
f"subprojects:{ os .getenv ('READTHEDOCS_PROJECT' )} /latest"
84
84
)
85
85
86
86
87
87
def setup (app : Sphinx ) -> None :
88
88
"""Set up custom Sphinx extension."""
89
- if rtd_ver : # if we’re on ReadTheDocs, hide the pydata-sphinx-theme search popup
90
- app .add_js_file ("scripts/rtd-sphinx-search.js" , loading_method = "defer" )
91
89
app .add_object_type (
92
90
"confval" ,
93
91
"confval" ,
Original file line number Diff line number Diff line change 70
70
71
71
from __future__ import annotations
72
72
73
+ import os
73
74
from typing import TYPE_CHECKING
74
75
from pathlib import Path
75
76
87
88
def setup (app : Sphinx ) -> dict [str , bool ]: # pragma: no cover
88
89
"""Set up theme (like an extension)."""
89
90
app .add_html_theme ("scanpydoc" , str (HERE ))
91
+
92
+ # if we’re on ReadTheDocs, hide the pydata-sphinx-theme search popup
93
+ if os .environ .get ("READTHEDOCS_VERSION" , "" ): # pragma: no cover
94
+ app .add_js_file ("scripts/rtd-sphinx-search.js" , loading_method = "defer" )
95
+
90
96
return dict (parallel_read_safe = True , parallel_write_safe = True )
You can’t perform that action at this time.
0 commit comments