diff --git a/docs/_templates/versions.html b/docs/_templates/versions.html new file mode 100644 index 000000000..c49f844c4 --- /dev/null +++ b/docs/_templates/versions.html @@ -0,0 +1,27 @@ +{%- if current_version %} +
+ + Other Versions + v: {{ current_version.name }} + + +
+ {%- if versions.tags %} +
+
Tags
+ {%- for item in versions.tags %} +
{{ item.name }}
+ {%- endfor %} +
+ {%- endif %} + {%- if versions.branches %} +
+
Branches
+ {%- for item in versions.branches %} +
{{ item.name }}
+ {%- endfor %} +
+ {%- endif %} +
+
+{%- endif %} \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 67a14f47a..f63627b62 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -66,25 +66,38 @@ def setup(app): import sys import os sys.path.insert(0, os.path.abspath('../python/')) -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.autosummary', 'sphinx.ext.coverage', 'sphinx.ext.napoleon'] +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.autosummary', 'sphinx.ext.coverage', 'sphinx.ext.napoleon', 'sphinx_multiversion'] autosummary_generate = True +# versioning config +smv_tag_whitelist = r'^(v1.1.1)$' +smv_branch_whitelist = r'^master$' +smv_remote_whitelist = None +smv_released_pattern = r'^tags/.*$' +smv_outputdir_format = '{ref.name}' +smv_prefer_remote_refs = False + # Sphinx gallery -extensions += ['sphinx_gallery.gen_gallery'] -from sphinx_gallery.sorting import FileNameSortKey -sphinx_gallery_conf = { - 'examples_dirs': '../python/tutorials/', - 'gallery_dirs': 'getting-started/tutorials', - 'filename_pattern': '', - 'ignore_pattern': r'__init__\.py', - 'within_subsection_order': FileNameSortKey, - 'reference_url': { - 'sphinx_gallery': None, - } -} +# extensions += ['sphinx_gallery.gen_gallery'] +# from sphinx_gallery.sorting import FileNameSortKey +# sphinx_gallery_conf = { +# 'examples_dirs': '../python/tutorials/', +# 'gallery_dirs': 'getting-started/tutorials', +# 'filename_pattern': '', +# 'ignore_pattern': r'__init__\.py', +# 'within_subsection_order': FileNameSortKey, +# 'reference_url': { +# 'sphinx_gallery': None, +# } +# } # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] +html_sidebars = { + '**': [ + '_templates/versions.html', + ], +} # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: