{# Add version selector This generates a version selector similar to the rtd version selector using the data exposed by `sphinx-multiversion` through current, latest_version and versions. It uses the same classes and ids as the version picker provided by the theme for use with readthedocs.io The css styling can be found in `css/version-selector.css`. The template doesn't fail when the needed data isn't provided but the result doesn't work as expected. #}
{# this element shows the current version and is visible by default It hides on hover while the element below becomes appears in its place. #} {# git icon indicating the version selector #} {# show current version; prepend `v` in case of branches #} {% if not current or not current.name.startswith("v") %} v: {% endif %} {{ current.name if current else "undefined" }} {% if revisions %} {# This item lists the available versions grouped into branches and tags. The item is hidden by default but appears when the user hovers over the version selector. #}
{% if tags %} {# List of tags #}
{{ _('Tags') }}
{% for item in tags %}
{{ item.name }}
{% endfor %}
{% endif %} {% if branches %} {# List of branches #}
{{ _('Branches') }}
{% for item in branches %}
{{ item.name }}
{% endfor %}
{% endif %}
{% endif %}