Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC Add versions to documentation #172

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
python -m pip install --upgrade pip
python -m pip install 'setuptools<50.0'
python -m pip install .[all,testing,docs]
python -m pip install sphinx_multiversion

- name: Get data
working-directory: doc
Expand All @@ -46,7 +47,7 @@ jobs:
uses: GabrielBB/xvfb-action@v1
with:
working-directory: doc
run: make html
run: @NAPARI_APPLICATION_IPY_INTERACTIVE=0 python sphinx-multiversion . _build

- name: Upload artifact
uses: actions/upload-artifact@v2
Expand Down
8 changes: 8 additions & 0 deletions doc/_templates/versioning.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% if versions %}
<h3>{{ _('Versions') }}</h3>
<ul>
{%- for item in versions %}
<li><a href="{{ item.url }}">{{ item.name }}</a></li>
{%- endfor %}
</ul>
{% endif %}
14 changes: 13 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
"sphinx_multiversion",
'sphinx.ext.napoleon',
'sphinxcontrib.bibtex',
'sphinx_copybutton',
Expand Down Expand Up @@ -152,7 +153,10 @@
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
"**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
"**": [
"logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html",
"versioning.html",
]
}

# -- Options for HTMLHelp output ------------------------------------------
Expand Down Expand Up @@ -207,3 +211,11 @@
'Skeleton analysis in Python.', 'Miscellaneous'
),
]

# sphinx-multiversion configuration
smv_tag_whitelist = r'^v.*$'
smv_branch_whitelist = None
smv_remote_whitelist = None
smv_released_pattern = r'^tags/.*$'
# Use tag name for output directory
smv_outputdir_format = '{ref.name}'