-
Notifications
You must be signed in to change notification settings - Fork 323
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
Version dropdown: should the "version_match" match the version or the name of the version? #556
Comments
ha, good catch. I'm actually not sure if this is working or not for MNE-Python because I didn't backport the theme's switcher to our stable docs, but I suspect that if I did, it wouldn't work. In fact for us it would probably still not work if we matched against release = mne.__version__ # The full version, including alpha/beta/rc tags.
version = '.'.join(release.split('.')[:2]) # The short X.Y version.
# (we need something like ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ for "stable" too!)
switcher_version_match = 'dev' if release.endswith('dev0') else version
html_theme_options = {
# (other entries omitted for brevity)
'switcher': {
'json_url': 'https://mne.tools/dev/_static/versions.json',
'url_template': 'https://mne.tools/{version}/',
'version_match': switcher_version_match,
}
} I don't know if that would be enough to fix things in the pandas case? Because I'm not familiar with the URL versioning scheme you folks use. MNE-Python uses this:
which is... messy. |
to say something a bit more coherent about this: The problem that I think has been revealed here is that the That said, maybe these two things could be decoupled. If each |
So for pandas, that table looks something like:
Currently, I use this long dropdown "version" that includes a larger part of the url, to overcome the messy url scheme (for historical reasons). Now, the idea of being able to override the "url_template" (#573), could maybe also used here to simplify the "version", and make it easier to match that version. And because of that complexity in the dropdown "version", in our case it's actually simpler to construct the dropdown "name" in our conf.py. But this problem will of course not be something generic. |
Something else that I noticed with the "matching" of the version, is that the documentation needs to be built specifically for a specific version. It's actually also not working on our own demo docs, but I think this has two reasons:
|
I think since the beginning of the year the documentation of the version switcher is now well explained. Is it still an issue ? |
This issue is on pause for several months and it's working on the latest pandas documentation version and on our site as well. The initial question is answered here : We are matching on |
See https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/configuring.html#configure-switcher-version-match for the explanation of the feature.
For the configuration of the version dropdown, you provide a json like
and so when specifying the
switcher['version_match']
in conf.py, there are two potential things that it could match: the "name" or the "version" from the json file.Currently, it tries to match the version:
pydata-sphinx-theme/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/_templates/version-switcher.html
Lines 68 to 75 in ef7d5a2
While starting to use the version dropdown for the pandas docs, I actually implemented this to match the "name" (pandas-dev/pandas#45370). The reason for this is because our "version" needs to follow the url scheme, and for historical reasons this is a bit complicated (so in our versions.json, the "name" entry is simpler)
Now, our case might of course be a bit specific.
But so that did me wonder in general which of the two would in practice be the most useful to try to match?
(cc @drammock)
The text was updated successfully, but these errors were encountered: