docs: Use PyData Sphinx Theme version switcher#2694
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2694 +/- ##
=======================================
Coverage 98.28% 98.28%
=======================================
Files 65 65
Lines 4305 4305
Branches 465 465
=======================================
Hits 4231 4231
Misses 46 46
Partials 28 28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7a01ca2 to
e631adc
Compare
Adds the switcher.json with all stable releases and configures html_theme_options to use the PyData version switcher widget and version warning banner (shown when browsing non-stable docs). Closes #2516 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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>
e631adc to
de9662b
Compare
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR migrates the pyhf documentation from a custom version warning and switcher implementation to the PyData Sphinx Theme's built-in version switcher. The theme configuration is updated to reference a version switcher JSON file, obsolete custom JavaScript logic and CSS styling are removed, and hardcoded development-version warnings are deleted from documentation pages. ChangesVersion Switcher Configuration
🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
matthewfeickert
left a comment
There was a problem hiding this comment.
@kratsg one comment / suggested change that I want your approval on, but then this is good to do.
| { | ||
| "name": "v0.7.6", | ||
| "version": "v0.7.6", | ||
| "url": "https://pyhf.readthedocs.io/en/v0.7.6/" | ||
| }, |
There was a problem hiding this comment.
@kratsg comparing with https://github.com/pydata/pydata-sphinx-theme/blob/d17eb2e1b7438164b92d40b947e01813a105fac3/docs/_static/switcher.json#L6-L21 as an example and noting from https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/announcements.html#version-warning-banners
This functionality relies on the version switcher to determine the version number of the latest stable release. It will only work if your version switcher .json has exactly one entry with property "preferred": true and your entries have version properties that are parsable by the compare-versions node module
...
If the active version compares less than the preferred version, the announcement will inform the user that they are viewing an older version of the documentation and provide a link to the preferred version. If the version compares greater than the preferred version (or if the version match contains the strings “dev”, “rc” or “pre”), the announcement will say they are viewing an unstable development version instead.
then I think we need to remove 0.7.6 to keep the version switcher from viewing 0.7.6 as somehow "older" than the stable version.
| { | |
| "name": "v0.7.6", | |
| "version": "v0.7.6", | |
| "url": "https://pyhf.readthedocs.io/en/v0.7.6/" | |
| }, |
There was a problem hiding this comment.
but then this is good to do.
Hm. We might need more work though as the ReadTheDocs build (and locally for me) isn't rendering any dropdown menu correctly. There is just an empty box where the options should be.
Pull Request Description
Use the PyData Sphinx Theme version switcher and version warning banner instead of the custom hand-rolled solution currently in the docs.
Closes #2516.
Checklist Before Requesting Reviewer
Before Merging
For the PR Assignees:
Summary by CodeRabbit
Documentation
Style