-
Notifications
You must be signed in to change notification settings - Fork 52
Add a version menu to the Sphinx build #394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
To make this work, a versions.json file will need to be added to the root of the gh-pages branch, which is a dict mapping "label": "path" for each version. This should be updated whenever a new version is tagged.
For example, here is the json for https://www.statsmodels.org/ https://github.com/statsmodels/statsmodels.github.io/blob/master/versions-v2.json We should also add a simple index.html with a redirect to "stable" or whatever at the root so that https://data-apis.org/array-api/ works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make this work, we need to add a
versions.json
file to the root of the gh-pages branch that looks like
Wouldn't we want to check in that file, like _static/versions.json
is suggesting?
Where label is the text label for the version and
target
is the name of the directory containing that version.
So the downside is that with this approach you cannot use a "normal" branching/tagging scheme to manage releases, you really have to copy over all files. And then things like cherry-picking won't work either, you have to manually copy-paste between versions if there's some fix you want to apply to older versions. And you may have to rebuild multiple versions?
Did you think about making this work with a regular git repo release flow, where we create a 2021
branch when we're ready to release that version?
@@ -62,6 +62,8 @@ | |||
('py:class', 'collections.abc.Sequence'), | |||
('py:class', "Optional[Union[int, float, Literal[inf, - inf, 'fro', 'nuc']]]"), | |||
('py:class', "Union[int, float, Literal[inf, - inf]]"), | |||
('py:obj', "typing.Optional[typing.Union[int, float, typing.Literal[inf, - inf, 'fro', 'nuc']]]"), | |||
('py:obj', "typing.Union[int, float, typing.Literal[inf, - inf]]"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it's going to be a continuous source of friction. Not a blocker for this PR, but can't we just turn off this cross-linking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you know how to do it let me know. When I looked there didn't seem to be a way.
@rgommers I think you might be confusing the sources with the deployed HTML. With this model, the sources do only have one branch ( The deployed branch ( The I don't really see any benefit to storing |
By the way, we can merge this now, before tagging the release. The actual version metadata goes in the versions.json in the gh-pages branch, which can be updated separately. So we can merge this now and add a versions.json with just a single "dev" version for now. |
To make this work, we need to add a
versions.json
file to the root of the gh-pages branch that looks likeWhere
label
is the text label for the version andtarget
is the name of the directory containing that version.Right now, without that, it will just say "No versions found".