From a59c7744f8acfd5a0ac216bb1a8cc8481e96429e Mon Sep 17 00:00:00 2001 From: Matias N Date: Thu, 26 Nov 2020 15:15:49 -0300 Subject: [PATCH] Documentation: support versioned docs --- Documentation/Makefile | 2 +- Documentation/_static/custom.css | 5 +++++ Documentation/_templates/layout.html | 6 +++--- Documentation/conf.py | 6 ++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index 7d19f170e6..73575e06ed 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -23,7 +23,7 @@ # You can set these variables from the command line, and also # from the environment for the first two. -SPHINXOPTS ?= -j auto +SPHINXOPTS ?= -j auto -A nuttx_versions="latest,${NUTTX_VERSIONS}" SPHINXBUILD ?= sphinx-build SOURCEDIR = . BUILDDIR = _build diff --git a/Documentation/_static/custom.css b/Documentation/_static/custom.css index 521e0f7f7b..f525eeb12a 100644 --- a/Documentation/_static/custom.css +++ b/Documentation/_static/custom.css @@ -86,3 +86,8 @@ span.menuselection border-radius: 3px; border: 1px solid rgb(204, 204, 204); } + +div.version-selector +{ + margin-bottom: 1em; +} diff --git a/Documentation/_templates/layout.html b/Documentation/_templates/layout.html index 8f7c20e5f0..3812e2b7c2 100644 --- a/Documentation/_templates/layout.html +++ b/Documentation/_templates/layout.html @@ -37,9 +37,9 @@ more modern -->
- + {% for nuttx_version in nuttx_versions.split(',') %} + {% endfor %}
diff --git a/Documentation/conf.py b/Documentation/conf.py index 734e95b699..668e764c8e 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -74,10 +74,12 @@ templates_path = ['_templates'] # This pattern also affects html_static_path and html_extra_path. exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] -# list of documentation versions to offer (besides latest) +# list of documentation versions to offer (besides latest). this will be +# overriden by command line option but we can provide a sane default +# this way html_context = dict() -html_context['nuttx_versions'] = ['latest'] +html_context['nuttx_versions'] = 'latest' # TODO: append other options using releases detected from git (or maybe just # a few hand-selected ones, or maybe just a "stable" option)