8000 Doc: Render version/language selector on Read the Docs by humitos · Pull Request #116966 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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

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

Merged
merged 5 commits into from
Apr 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Doc: add hardcoded links to the official docs
  • Loading branch information
humitos committed Apr 9, 2024
commit 7c27128c15289261c530d457eb580bde1f7405f9
29 changes: 27 additions & 2 deletions Doc/tools/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,35 @@
document.addEventListener("readthedocs-addons-data-ready", function(event) {
event.detail.initialize();
event.detail.data().then((config) => {
// TODO: add `selected="selected"` to option
// Add some mocked hardcoded versions pointing to the official
// documentation while migrating to Read the Docs.
// These are only for testing purposes.
// TODO: remove them when managing all the versions on Read the Docs,
// since all the "active, built and not hidden" versions will be shown automatically.
let versions = config.versions.active.concat([
{
slug: "dev (3.13)",
urls: {
documentation: "https://docs.python.org/3.13/",
}
},
{
slug: "3.12",
urls: {
documentation: "https://docs.python.org/3.12/",
}
},
{
slug: "3.11",
urls: {
documentation: "https://docs.python.org/3.11/",
}
},
]);

const versionSelect = `
<select id="version_select">
${ config.versions.active.map(
${ versions.map(
(version) => `
<option
value="${ version.slug }"
Expand Down
0