Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport fix for broken documentation search (#1969)
- Loading branch information
1 parent
f86e0df
commit 1fab60e
Showing
5 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
""" | ||
A temporary fix for https://github.com/pydicom/pydicom/issues/1965 | ||
while waiting for upstream sphinx_rtd_theme to fix/remove their | ||
dependency on jQuery. | ||
""" | ||
from pathlib import Path | ||
import re | ||
|
||
|
||
search_html = Path("./_build/html/search.html") | ||
assert search_html.exists() | ||
|
||
with open(search_html) as fp: | ||
html = fp.read() | ||
|
||
pat = r"(<script>\s+jQuery.+searchindex\.js.+\s+<\/script>)" | ||
repl = r'<script src="searchindex.js" defer></script>' | ||
# re.findall(pat, html) | ||
html_fixed = re.sub(pat, repl, html) | ||
|
||
with open(search_html, "w") as fp: | ||
fp.write(html_fixed) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters