sphinx_rtd_theme
sphinx_rtd_theme copied to clipboard
Remove all instances of READTHEDOCS
The removes all the if checks for read the docs.
On read the docs builds this content is now injected. However, we want to support non read the docs builds and provide a way to generate the version menu.
This diff includes changes from #578 and #983
Fixes #650
This will also need some changes on RTD side
This is another design decision to get back to, probably.
Based on our most recent conversations, our badge flyout version selector menu is actually going to move outside the theme. Maintaining that as part of our sphinx theme is a fairly confusing pattern.
The version of the version selector that is built into this theme may or may not be a feature of Read the Docs as well, in which case we don't want to support that for outside projects -- at least not on our theme.
We instead would want to expose version and language selection as integrated features for the theme, not as part of the menu.
In a project of my own, I'm trying to use the READTHEDOCS
var to detect whether the current_version
is available as is done here:
https://github.com/readthedocs/sphinx_rtd_theme/blob/3532ffc89bbf89ef7d2ac62d65b3683f588a9673/sphinx_rtd_theme/layout.html#L156-L158
Two questions then:
- If
READTHEDOCS
is removed, how can I detect whether RTD metadata (like PR vs non-PR builds) is vailable - ~This already seems to have stopped working~ - where is the
READTHEDOCS
variable populated?
@eric-wieser this task is to remove all the instances where the READTHEDOCS
var is used in the theme, the var is populated from https://github.com/readthedocs/readthedocs.org/blob/master/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl there are no intentions of removing the var itself, just the instances of it in the theme.
I'm adding this one to the roadmap since we are moving forward with the addons injection and all these READTHEDOCS
checks won't be required anymore. We are getting closer to be able to remove all this code from here 🎉