-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use sphinx_multiversion to make multiversioned docs
sphinx-multiversion can build a copy of the documentation for each tag and place in a subfolder. The existing spinx setup can build the top level latest version. versioning.html gives links to version in the sidebar. layout.html overrides the main template to use correct versions in the title and top navigation bar. Note this requires a patch to sphinx_multiversion to allow calling a prebuild command. This is used to call the docs_api for each checkout. sphinx-contrib/multiversion#62
- Loading branch information
1 parent
3bbf042
commit 801d32a
Showing
6 changed files
with
59 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ gitpython == 3.1.0 | |
flake8 | ||
pylint | ||
sphinx | ||
sphinx-multiversion | ||
mypy | ||
yapf | ||
pytest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
div.versions {margin-top: 10px} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{%- extends "!layout.html" %} | ||
{%- block htmltitle %} | ||
{% if versions %} | ||
<title>{{ title|striptags|e }} - {{ project }} {{ current_version.name }} Documentation</title> | ||
{% else %} | ||
<title>{{ title|striptags|e }}{{ titlesuffix }}</title> | ||
{% endif %} | ||
{%- endblock %} | ||
|
||
{%- block rootrellink %} | ||
{% if versions %} | ||
<li class="nav-item nav-item-0"><a href="{{ pathto(master_doc)|e }}">{{ project }} {{ current_version.name }} Documentation</a>{{ reldelim1 }}</li> | ||
{% else %} | ||
<li class="nav-item nav-item-0"><a href="{{ pathto(master_doc)|e }}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li> | ||
{% endif %} | ||
{%- endblock %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{% if versions %} | ||
<div class="versions"> | ||
<h3>{{ _('Versions') }}</h3> | ||
<ul> | ||
<li><a href="../{{ pathto("",1)}}index.html">Latest</a></li> | ||
{%- for item in versions %} | ||
<li><a href="{{ item.url }}">{{ item.name }}</a></li> | ||
{%- endfor %} | ||
</ul> | ||
</div> | ||
{% else %} | ||
<div class="versions"> | ||
<h3>{{ _('Versions') }}</h3> | ||
<ul> | ||
<li><a href="{{ pathto("",1)}}index.html">Latest</a></li> | ||
{%- for item in ['0.9.0', '1.0.0', '1.1.0'] %} | ||
<li><a href="{{ pathto("",1)}}{{ item }}/index.html">{{ item }}</a></li> | ||
{%- endfor %} | ||
</ul> | ||
</div> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters