moved latest warning banner logic to conf.py #5508
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 Pull Request
Description
Moved the latest warning banner logic from a template into
conf.py
. A recent feature added to the pydata-sphinx-theme allows this, see https://pydata-sphinx-theme.readthedocs.io/en/latest/user_guide/announcements.html#provide-local-html-in-your-themeThe theme does have a version switcher banner (see https://pydata-sphinx-theme.readthedocs.io/en/latest/user_guide/version-dropdown.html) but this uses a json file to list all versions. We automate this via Read The Docs so was not a suitable option, just using the announcement feature works.
Current banner
New banner (this PR)
The text is also shortened which reads better imho. Note the "dirty" release version, this is due to the docs being built locally and not on Read the Docs. This new banner is only visible once build on Read The Docs AND it is the latest docs, so this PR docs build should work but not show the banner. This was tested by overriding some variables, see https://github.com/SciTools/iris/blob/main/docs/src/conf.py#L57
A whatsnew will be done in a separate PR.
Consult Iris pull request check list