Skip to content

Commit

Permalink
Add fix for search not working (#956)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaramallion authored Jul 27, 2024
1 parent 8583125 commit 1a99459
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
|coverage| |unit-tests| |type-hints| |docs| |black| |pypi-versions| |python-versions| |conda| |zenodo|

.. |coverage| image:: https://codecov.io/gh/pydicom/pynetdicom/branch/main/graph/badge.svg
.. |coverage| image:: https://codecov.io/gh/pydicom/pynetdicom/branch/main/graph/badge.svg
:target: https://codecov.io/gh/pydicom/pynetdicom

.. |unit-tests| image:: https://github.com/pydicom/pynetdicom/workflows/unit-tests/badge.svg
Expand Down Expand Up @@ -44,7 +44,7 @@ medical images and related information. It defines the formats and communication
protocols for media exchange in radiology, cardiology, radiotherapy and other
medical domains.

*pynetdicom* is a pure Python 3.7+ package that implements the DICOM
*pynetdicom* is a pure Python package that implements the DICOM
networking protocol. Working with
`pydicom <https://github.com/pydicom/pydicom>`_, it allows the easy creation
of DICOM *Service Class Users* (SCUs) and *Service Class Providers* (SCPs).
Expand Down
1 change: 1 addition & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ html:
rm -rf $(BUILDDIR)/html/_images
#rm -rf _build/doctrees/
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
python fix_search.py
touch $(BUILDDIR)/html/.nojekyll
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
Expand Down
19 changes: 19 additions & 0 deletions docs/fix_search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""
A temporary fix for #953 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>'
html_fixed = re.sub(pat, repl, html)

with open(search_html, "w") as fp:
fp.write(html_fixed)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ maintainers = [
]
name = "pynetdicom"
readme = "README.rst"
version = "2.1.0"
version = "2.1.1"


[tool.poetry.dependencies]
Expand Down

0 comments on commit 1a99459

Please sign in to comment.