forked frompython/docsbuild-scripts
- Notifications
You must be signed in to change notification settings - Fork2
Commite5753a1
committed
Generate version selector dynamically via JavaScript
_Note this is just a proof of concept to start the conversation._While working on the idea to generate the version/language selectors and combinethem with the data fetched from Read the Docs API, I realized that if we aremigrating only _one_ version to Read the Docs and using a proxy to serve it atthe official `docs.python.org` domain, there is no need to use a differentversion/language selector at all --since all the URLs will be the same and all theJavaScript logic will be the same. The proxy will do the magic to redirect toRead 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 JavaScriptwhen the page is served.Do we have a JSON file from where we can populate the `LANGUAGES` variable?I'm opening a PR here to show what I'm thinking and discuss if this is theapproach we want to follow. BTW, the code is not tested. I just wrote it as anexample to show what I'm thinking is the direction.Related:-python/python-docs-theme#193-python/docs-community#5[^1]: Once all the versions/languages are migrated to Read the Docs, we won'trequire the `release-cycle.json` nor other file to populate the `LANGUAGES`variable because this data will come from Read the Docs Addons API.1 parent2135304 commite5753a1
1 file changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
22 | 34 | | |
23 | 35 | | |
24 | 36 | | |
| |||
0 commit comments
Comments
(0)