This is an automated email from the ASF dual-hosted git repository. btashton pushed a commit to branch releases/10.0 in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/releases/10.0 by this push: new f838f9f Documentation: support versioned docs f838f9f is described below commit f838f9f4eb2a595ae3b8add68cd904f2e8e21693 Author: Matias N <mat...@protobits.dev> AuthorDate: Thu Nov 26 15:15:49 2020 -0300 Documentation: support versioned docs --- Documentation/Makefile | 2 +- Documentation/_static/custom.css | 13 +++++++++++++ Documentation/_templates/layout.html | 6 +++--- Documentation/conf.py | 6 ++++-- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index 7d19f17..73575e0 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 a861bdb..f525eeb 100644 --- a/Documentation/_static/custom.css +++ b/Documentation/_static/custom.css @@ -78,3 +78,16 @@ kbd { -webkit-border-radius: 3px; text-shadow: 0 1px 0 #fff; } + +span.menuselection +{ + margin: 0px 0.1em; + padding: 0.1em 0.1em; + 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 2a3ebcd..4f4072b 100644 --- a/Documentation/_templates/layout.html +++ b/Documentation/_templates/layout.html @@ -37,9 +37,9 @@ more modern --> <div class="version-selector"> - <select> - {% for nuttx_version in nuttx_versions %} - <option value="{{ nuttx_version }}" {% if nuttx_version == version %}selected="selected"{% endif %}>{{ nuttx_version }}</option> + <select onchange="javascript:location.href = this.value;"> + {% for nuttx_version in nuttx_versions.split(',') %} + <option value="{{ url_root }}../{{ nuttx_version }}" {% if nuttx_version == version %}selected="selected"{% endif %}>{{ nuttx_version }}</option> {% endfor %} </select> </div> diff --git a/Documentation/conf.py b/Documentation/conf.py index 40cda45..e935a30 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)