-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Doc: Render version/language selector on Read the Docs #116966
Conversation
Integrate the new Read the Docs Addons JavaScript into the Python Docs Sphinx theme to render versions and languages selector nicely. References: * Discord thread: https://discord.com/channels/935215565872693329/1159601953265942589 * Implementation of Addons JavaScript `CustomEvent`: readthedocs/addons#64 * Conversation about using Read the Docs: python/docs-community#5
Follow the changes done in readthedocs/readthedocs.org#11205
I the Discord conversation some weeks ago, we agreed on these following steps:
I was able to work more on the Read the Docs side and I'm waiting for some PRs to be reviewed, merged and deployed there. In the meanwhile, I updated this PR with some changes required to match the API JSON structure (we are freezing on |
The required upstream PRs were already merged and we are going to release/deploy them today in a few hours. I pushed the latest required changes to this PR and tested it locally. Everything works as expected, so we are ready to move to the next step. @hugovk I'd appreciate a small review/approve here and decide whether or not to ask someone else for feedback at this stage. We can also move forward and merge this PR first and after that ask for feedback on the deployed version of the docs under Read the Docs at |
This is deployed and can be previewed at https://cpython-previews--116966.org.readthedocs.build/en/116966/ |
Thanks, this is looking good, let's merge and iterate! |
(cherry picked from commit ae8dfd2) Co-authored-by: Manuel Kaufmann <[email protected]>
GH-118038 is a backport of this pull request to the 3.12 branch. |
) (#118038) Co-authored-by: Manuel Kaufmann <[email protected]>
Integrate the new Read the Docs Addons into the Python Docs Sphinx theme to render versions and languages selector nicely, using the JavaScript
readthedocs-addons-data-ready
custom event triggered by the Read the Docs Addons.References:
CustomEvent
: API: use<meta>
to define supported API version and triggerCustomEvent
readthedocs/addons#64I'm opening this PR here as a POC to continue the conversation on the Discord thread linked.
Example
This example was built locally on a development Read the Docs instance. The languages and versions shown in the example are:
It shows
readthedocs-selector
because it's the branch where I was making these changes. It showslatest
, because I forgot to disable it 😄📚 Documentation preview 📚: https://cpython-previews--116966.org.readthedocs.build/