docs: consume fd.io version list

Type: feature

This adds a version snippet in the
vpp docs, based on a json description
fetched from fd.io/vpp_versions.json

This relies on https://github.com/FDio/site/pull/108
being merged

Change-Id: I6dd22f09927841aef96011ed57af2cbdc5d409f5
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
This commit is contained in:
Nathan Skrzypczak 2021-10-29 12:05:29 +02:00 committed by Dave Wallace
parent cbc81eae6e
commit ae5609721b
2 changed files with 35 additions and 6 deletions

33
docs/_templates/versions.html vendored Normal file
View File

@ -0,0 +1,33 @@
{# This overrides ./sphinx_rtd_theme/versions.html #}
{# from https://github.com/readthedocs/sphinx_rtd_theme.git #}
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="{{ _('Versions') }}">
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book"> VPP versions</span>
{% set version_split = version.split('-') %}
{{ version_split[0] }}
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
<dl id="version-container">
<!-- versions will end up here -->
</dl>
<dl>
<dt>Other links</dt>
<dd>
<a href="https://fd.io">Project Home</a>
</dd>
</dl>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$.getJSON( "https://fd.io/vpp_versions.json", function( data ) {
let cont = $("#version-container");
cont.empty();
cont.append('<dt>Versions</dt>');
$.each( data, function( key, val ) {
cont.append('<dd><a href="' + val.link + '">' + val.name + '</a></dd>');
});
});
});
</script>

View File

@ -88,15 +88,11 @@ pygments_style = 'default'
# import sphinx_theme
templates_path = ['_templates']
html_theme = "sphinx_rtd_theme"
# html_theme = 'neo_rtd_theme'
html_theme_path = ["_themes", ]
# html_theme_path = [sphinx_theme.get_html_theme_path('neo-rtd-theme')]
# All available themes:
# print(sphinx_theme.THEME_LIST)
# >> ['stanford_theme', 'neo_rtd_theme']
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.