Skip to content

Commit e631adc

Browse files
kratsgclaude
andcommitted
docs: Replace custom version banner with PyData theme built-in
Remove the hand-rolled dev-version warning (raw HTML in index.rst and citations.rst, JS detection in custom.js, and CSS in custom.css) now that show_version_warning_banner from PyData Sphinx Theme covers the same use case. Also exempt switcher.json from the docs/_*/ gitignore rule so force-add is not needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 059c5bb commit e631adc

6 files changed

Lines changed: 1 addition & 60 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ docs/config.rst
99
docs/gh-pages
1010
docs/pyhf.*.rst
1111
docs/_*/
12+
!docs/_static/switcher.json
1213
*.py[co]
1314
__pycache__
1415
*.egg-info

docs/_static/css/custom.css

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,3 @@
22
.wy-nav-content {
33
max-width: 1200px !important;
44
}
5-
6-
/* version warning badge */
7-
#dev-version {
8-
display: none;
9-
}
10-
11-
#dev-version.version-warning {
12-
display: block;
13-
}
14-
15-
p.version-warning {
16-
position: sticky;
17-
top: 10px;
18-
19-
margin: 10px 0;
20-
padding: 5px 10px;
21-
border-radius: 4px;
22-
23-
letter-spacing: 1px;
24-
color: #fff;
25-
text-shadow: 0 0 2px #000;
26-
text-align: center;
27-
28-
background: #900 repeating-linear-gradient(
29-
135deg,
30-
transparent,
31-
transparent 56px,
32-
rgba(255, 255, 255, 0.35) 56px,
33-
rgba(255, 255, 255, 0.35) 112px
34-
);
35-
}
36-
37-
p.version-warning a {
38-
color: #fff;
39-
text-decoration: none;
40-
border-bottom: 1px dotted #fff;
41-
}
42-
43-
p.version-warning a:hover {
44-
border-bottom-style: solid;
45-
}
46-
/* -------------------------- */

docs/_static/js/custom.js

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

docs/citations.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
Use and Citations
22
=================
33

4-
.. raw:: html
5-
6-
<p id="dev-version"><strong>Warning:</strong> This is a development version and should not be cited. To find the specific version to cite, please go to <a href="https://pyhf.readthedocs.io/">ReadTheDocs</a>.</p>
7-
84
Citation
95
--------
106

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ def setup(app):
292292
]
293293

294294
html_js_files = [
295-
"js/custom.js",
296295
(
297296
"https://views.scientific-python.org/js/plausible.js",
298297
{"data-domain": "pyhf.readthedocs.io", "defer": "defer"},

docs/index.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
release-notes
2323
contributors
2424

25-
.. raw:: html
26-
27-
<p id="dev-version"><strong>Warning:</strong> This is a development version. The latest stable version is at <a href="https://pyhf.readthedocs.io/">ReadTheDocs</a>.</p>
28-
2925
..
3026
Comment: Splice the JupyterLite example into the README by looking for a particular comment
3127

0 commit comments

Comments
 (0)