Skip to content

Commit d834713

Browse files
committed
docs(chore[spa]): drop spa-copybutton-reinit.js shim; gp-sphinx handles it now
The shim was a project-local workaround for two gp-sphinx bugs in ``spa-nav.js::addCopyButtons``: clone-based template failed on pages without code blocks, and only ``div.highlight pre`` was iterated (not the full configured ``copybutton_selector``, so prompt blocks went buttonless after SPA swap). Both are fixed upstream in gp-sphinx (#20): inline HTML template and ``window.GP_SPHINX_COPYBUTTON_SELECTOR`` bridge. The shim's responsibilities collapse into the theme's own code, so remove it from conf.py's ``app.add_js_file`` list and delete the file. ``prompt-copy.js`` stays — it's unrelated: it implements Markdown- preserving copy (backtick-wrapping ``<code>`` children) for prompt admonitions, which sphinx-copybutton's ``innerText``-based copy flattens. That behavior has nothing to do with SPA navigation and uses document-level event delegation to survive DOM swaps.
1 parent b4a01e1 commit d834713

2 files changed

Lines changed: 0 additions & 138 deletions

File tree

docs/_static/js/spa-copybutton-reinit.js

Lines changed: 0 additions & 137 deletions
This file was deleted.

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ def setup(app: Sphinx) -> None:
142142
_gp_setup(app)
143143
app.connect("autodoc-process-docstring", _convert_md_xrefs)
144144
app.add_js_file("js/prompt-copy.js", loading_method="defer")
145-
app.add_js_file("js/spa-copybutton-reinit.js", loading_method="defer")
146145
app.add_css_file("css/project-admonitions.css")
147146

148147

0 commit comments

Comments
 (0)