Doc: Render version/language selector on Read the Docs by humitos · Pull Request #116966 · python/cpython · GitHub
Skip to content

Doc: Render version/language selector on Read the Docs - #116966

Merged
hugovk merged 5 commits into
python:mainfrom
readthedocs:readthedocs-selectors
Apr 17, 2024
Merged

Doc: Render version/language selector on Read the Docs#116966
hugovk merged 5 commits into
python:mainfrom
readthedocs:readthedocs-selectors

Conversation

@humitos

@humitos humitos commented Mar 18, 2024

Copy link
Copy Markdown
Contributor

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:

I'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:

  • translations configured on the development Read the Docs instance
  • active, built and not hidden versions on the development Read the Docs instance

It shows readthedocs-selector because it's the branch where I was making these changes. It shows latest, because I forgot to disable it 😄

Peek 2024-03-18 17-54

Note this PR is not linked to any issue yet since it comes from a Discord conversation


📚 Documentation preview 📚: https://cpython-previews--116966.org.readthedocs.build/

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
@humitos

humitos commented Apr 9, 2024

Copy link
Copy Markdown
Contributor Author

@humitos

humitos commented Apr 16, 2024

Copy link
Copy Markdown
Contributor Author

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 cpython-previews project.

@humitos

humitos commented Apr 16, 2024

Copy link
Copy Markdown
Contributor Author

The required upstream PRs were already merged and we are going to release/deploy them today in a few hours

This is deployed and can be previewed at https://cpython-previews--116966.org.readthedocs.build/en/116966/

@hugovk

hugovk commented Apr 17, 2024

Copy link
Copy Markdown
Member

Thanks, this is looking good, let's merge and iterate!

@hugovk hugovk changed the title Doc: POC of rendering version/language selector on Read the Docs Doc: Render version/language selector on Read the Docs Apr 17, 2024
@hugovk
hugovk merged commit ae8dfd2 into python:main Apr 17, 2024
@hugovk hugovk added the needs backport to 3.12 only security fixes label Apr 18, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @humitos for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 18, 2024
(cherry picked from commit ae8dfd2)

Co-authored-by: Manuel Kaufmann <humitos@gmail.com>
@bedevere-app

bedevere-app Bot commented Apr 18, 2024

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants