Documentation: support versioned docs #2408
Merged
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.
Summary
This makes the version selector in the documentation to be functional. On a local build the selector will always show "latest" and will not be usable, but the Makefile now will now read the NUTTX_VERSIONS environment variable, which can be either empty (the usual) or have a list of comma-separated nuttx version names (eg: "10.0,10.1"). This will populate the selector and the documentation will go to /. The "latest" version is always defined and does not need to be added to NUTTX_VERSIONS.
To complete support for this, a change needs to be done on the website to pass the list of versions to expose via this variable.
By supporting this via an environment variable, every version of the documentation will have links to all exposed versions (since it is not a hardcoded list in the documentation). So to have this on final 10.0 release, we would have to merge this before generating the final tag.
Impact
Documenation
Testing
Tested by defining NUTTX_VERSIONS locally.