[TASK] Improve AJAX version switcher to sort and group languages and links, document workflow #583
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WHY
Currently the AJAX version selector to change the context of a rendered documentation to another language or version has multiple issues:
This PR hopefully 'catches them all'.
CAVEAT
One extra problem is important to note: I initially wanted to adjust this server-side. However, the code used for that (garvinhicking/site-intercept@aec6c1e) is in the domain of the TYPO3 GmbH, and the Documentation team cannot easily take over Maintenance for an active server-side component. Thus it was decided to fix the problem client-side, using the provided JSON data from the docs.typo3.org API (TYPO3GmbH/site-intercept#158).
WHAT
This PR contains:
Documentation/Developer/AjaxVersions.rst
with more insightThe most glaring sad trombone sound stems from a necessary static language fixation. The
versions.js
file needs to be updated for new languages published to docs.typo3.org. On the upside, for years now the docs were only rendered in english, and only 2 or 3 documentations exist in another language. For a future improvement maybe we find a JSON language file that has a list of language keys like 'de-de' and their associated language name, that we can use or enhance. It's not so often that new languages get added.HOW
Details are, as mentioned, in
Documentation/Developer/AjaxVersions.rst
. To quickly simulate this you must:make docs
packages/typo3-docs-theme/assets/js/versions-proxy.php
toDocumentation-GENERATED-temp/versions-proxy.php
ddev launch
to view the rendered DocumentationYou probably want to simulate a different menu getting rendered. You can do this by:
document.getElementById('toc-version').setAttribute('data-override-url-self', 'https://docs.typo3.org/other/t3docs/render-guides/main/en-us/Developer/InterlinkInventories.html');
render-guides
.OUTLOOK
We can possibly improve the design of the language selector, and adjust the nesting appearance for languages. Maybe we can also separate the language selection from the version selection.