Title: Generate version selector dynamically via JavaScript by humitos · Pull Request #179 · python/docsbuild-scripts · GitHub
Open Graph Title: Generate version selector dynamically via JavaScript by humitos · Pull Request #179 · python/docsbuild-scripts
X Title: Generate version selector dynamically via JavaScript by humitos · Pull Request #179 · python/docsbuild-scripts
Description: Note this is just a proof of concept to start the conversation. While working on the idea to generate the version/language selectors and combine them with the data fetched from Read the Docs API, I realized that if we are migrating only one version to Read the Docs and using a proxy to serve it at the official docs.python.org domain, there is no need to use a different version/language selector at all --since all the URLs will be the same and all the JavaScript logic will be the same. The proxy will do the magic to redirect to Read the Docs only the versions configured in the proxy 1. However, since when building on Read the Docs the variables VERSIONS and LANGUAGES are not passed, we need to populate them dynamically with JavaScript when the page is served. ToDo Populate all_languages in the same way. Do we have a JSON file from where we can populate the LANGUAGES variable? Move this switchers.js file to https://github.com/python/cpython/tree/main/Doc/tools/static I'm opening a PR here to show what I'm thinking and discuss if this is the approach we want to follow. BTW, the code is not tested. I just wrote it as an example to show what I'm thinking is the direction. cc @hugovk Related: python/python-docs-theme#193 python/docs-community#5 Footnotes Once all the versions/languages are migrated to Read the Docs, we won't require the release-cycle.json nor other file to populate the LANGUAGES variable because this data will come from Read the Docs Addons API. ↩
Open Graph Description: Note this is just a proof of concept to start the conversation. While working on the idea to generate the version/language selectors and combine them with the data fetched from Read the Docs API, I...
X Description: Note this is just a proof of concept to start the conversation. While working on the idea to generate the version/language selectors and combine them with the data fetched from Read the Docs API, I...
Opengraph URL: https://github.com/python/docsbuild-scripts/pull/179
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:2d2dafcc-3408-9116-9bc7-6a91341fdb62 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 8F4A:A560A:F0DA2C:1405B43:69705086 |
| html-safe-nonce | 27d94705599125cf52c2d2de161d932a3d68558ba2bec4195440ffea1d7a5b42 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjRBOkE1NjBBOkYwREEyQzoxNDA1QjQzOjY5NzA1MDg2IiwidmlzaXRvcl9pZCI6IjU3ODQ5NDY1MjI4MjIwMzc2MzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 81b85e54b86ff4e2b82ecf5ee1f76663d612a5e20717d6073fa4e65065076495 |
| hovercard-subject-tag | pull_request:1983508795 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/docsbuild-scripts/pull/179/checks |
| twitter:image | https://avatars.githubusercontent.com/u/244656?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/244656?s=400&v=4 |
| og:image:alt | Note this is just a proof of concept to start the conversation. While working on the idea to generate the version/language selectors and combine them with the data fetched from Read the Docs API, I... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/docsbuild-scripts git https://github.com/python/docsbuild-scripts.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 23553472 |
| octolytics-dimension-repository_nwo | python/docsbuild-scripts |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 23553472 |
| octolytics-dimension-repository_network_root_nwo | python/docsbuild-scripts |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f643964067a552f02067066d6a910b2f90a5721f |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width