You're reading the documentation for a development version. For the latest released version, please have a look at 0.3.2.

HTML Context#

The following variables and functions are exposed to the Sphinx HTML builder context in all versions.

Version Objects#

All versions will be exposed to the HTML context as Version objects with the following attributes:

name#

The branch or tag name.

url#

The URL to the current page in this version.

version#

The value of the version variable in conf.py.

release#

The value of the release variable in conf.py.

is_released#

True if this version matches the configured smv_released_pattern regular expression, else False.

Versions#

The most important variable is versions, which can be used to iterate over all found (and whitelisted) versions.

versions#

An iterable that yields all Version objects.

<h3>Versions</h3>
<ul>
  {%- for item in versions %}
  <li><a href="{{ item.url }}">{{ item.name }}</a></li>
  {%- endfor %}
</ul>
versions.branches#

You can use the branches property of the versions iterable to get the Version objects for all branches.

<h3>Branches</h3>
<ul>
  {%- for item in versions.branches %}
  <li><a href="{{ item.url }}">{{ item.name }}</a></li>
  {%- endfor %}
</ul>
versions.tags#

You can use the tags property of the versions iterable to get the Version objects for all tags.

<h3>Tags</h3>
<ul>
  {%- for item in versions.tags %}
  <li><a href="{{ item.url }}">{{ item.name }}</a></li>
  {%- endfor %}
</ul>
versions.releases#

You can use the releases property of the versions iterable to get all Version objects where the ìs_released attribute is True. This is determined by the smv_released_pattern in the Configuration.

<h3>Releases</h3>
<ul>
  {%- for item in versions.releases %}
  <li><a href="{{ item.url }}">{{ item.name }}</a></li>
  {%- endfor %}
</ul>
versions.in_development#

You can use the in_development property of the versions iterable to get all Version objects where the ìs_released attribute is False. This is determined by the smv_released_pattern in the Configuration.

<h3>In Development</h3>
<ul>
  {%- for item in versions.in_development %}
  <li><a href="{{ item.url }}">{{ item.name }}</a></li>
  {%- endfor %}
</ul>

Functions#

Similar to Sphinx’s hasdoc() function.

vhasdoc(other_version)#

This function is Similar to Sphinx’s hasdoc() function. It takes other_version as string and returns True if the current document exists in another version.

{% if vhasdoc('master') %}
This page is available in <a href="../master/index.html">master</a>.
{% endif %}
vpathto(other_version)#

This function is Similar to Sphinx’s pathto() function. It takes other_version as string and returns the relative URL to the current page in the other version. If the current page does not exist in that version, the relative URL to its master_doc is returned instead.

{% if vhasdoc('master') %}
This page is also available in <a href="{{ vpathto('master') }}">master</a>.
{% else %}
Go to <a href="{{ vpathto('master') }}">master</a> for the latest docs.
{% endif %}

Other Variables#

current_version#

A Version object for of the current version being built.

<h3>Current Version: {{ current_version.name }}</h3>
latest_version#

A Version object of the latest released version being built.

<h3>Latest Version: {{ latest_version.name }}</h3>