Conversation
Configure PyData Sphinx Theme's version switcher and add a new `docs/_static/versions.json` file where versions and their respective urls are listed.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #371 +/- ##
=======================================
Coverage 86.25% 86.25%
=======================================
Files 89 89
Lines 18695 18695
Branches 2959 2959
=======================================
Hits 16125 16125
Misses 1884 1884
Partials 686 686 ☔ View full report in Codecov by Sentry. |
|
@jcapriot let me know what do you think. Feel free to modify the |
|
Let's keep it referenced by the actual full name of the tag, so including the "v". |
|
Leave the "v" in the "version" section of the switcher json and the "url", (you can remove it in the name). |
santisoler
left a comment
There was a problem hiding this comment.
Sorry for stepping over your toes in that commit (I didn't see you change). I left two comments explaining why we actually need to remove the leading v.
| }, | ||
| { | ||
| "name": "0.10.0 (latest)", | ||
| "version": "v0.10.0", |
There was a problem hiding this comment.
Actually, the version field should not have the leading v because these versions should be parsable by the compare-versions node module (https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/announcements.html#version-warning-banners).
This way, the warning version banners can behave properly. If we have the v, any previous version is recognized as a development version, so the banner shows the wrong text.
We can still use the leading v in the url though.
There was a problem hiding this comment.
compare_versions ignores any leading v
https://www.npmjs.com/package/compare-versions
There was a problem hiding this comment.
I actually experienced a misbehaviour in the version banner in simpeg before I changed the versions to not have a leading v. But yes, you're right that they seem to support it...
Ignore this then and we'll see if it works well.
There was a problem hiding this comment.
It looks like the pydata sphinx theme uses the leading v in their's for matching, https://github.com/pydata/pydata-sphinx-theme/blob/main/docs/_static/switcher.json
There was a problem hiding this comment.
Then maybe there was something else that was failing back then... Well, I'm glad we don't have to fix it.
| if discretize_version.is_devrelease: | ||
| branch = "main" | ||
| else: | ||
| branch = f"v{version}" |
There was a problem hiding this comment.
We should also remove the leading v from here for the version to be parsable.
| branch = f"v{version}" | |
| branch = version |
Configure PyData Sphinx Theme's version switcher and add a new
docs/_static/versions.jsonfile where versions and their respective urls are listed.