From 3ad7f9106bf204b18fd78efcd5a7ae32ae8c8828 Mon Sep 17 00:00:00 2001 From: Randy LeVeque Date: Sun, 5 Apr 2020 15:54:35 -0700 Subject: [PATCH 1/4] update conf.py to use sphinx-multiversion --- doc/_templates/versioning.html | 14 ++++++++++++++ doc/conf.py | 23 +++++++++++++++++------ 2 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 doc/_templates/versioning.html diff --git a/doc/_templates/versioning.html b/doc/_templates/versioning.html new file mode 100644 index 0000000..f9b8d48 --- /dev/null +++ b/doc/_templates/versioning.html @@ -0,0 +1,14 @@ +{% if versions %} +

{{ _('Latest') }}

+ +

{{ _('Older') }}

+ +{% endif %} diff --git a/doc/conf.py b/doc/conf.py index 523334b..05b8549 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -40,10 +40,11 @@ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx',#'plot_directive', - 'only_directives', - 'sphinx.ext.inheritance_diagram'] + 'only_directives', # 'edit_on_github', # broken + 'sphinx.ext.inheritance_diagram', 'nbsphinx', + 'sphinx_multiversion'] -nbsphinx_allow_errors = False +nbsphinx_allow_errors = True extensions.append('sphinx.ext.mathjax') mathjax_path = 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' @@ -52,10 +53,11 @@ # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] + # The suffix of source filenames. source_suffix = '.rst' edit_on_github_project = 'clawpack/doc' -edit_on_github_branch = 'master/doc' +edit_on_github_branch = 'master/dev' # The encoding of source files. #source_encoding = 'utf-8' @@ -128,11 +130,20 @@ # Custom sidebar templates, maps document names to template names. html_sidebars = { - 'index': ['localtoc.html', 'sourcelink.html', 'searchbox.html'], + 'index': ['localtoc.html', 'sourcelink.html', 'searchbox.html', + 'versioning.html'], '**': ['localtoc.html', 'relations.html', - 'sourcelink.html', 'searchbox.html'] + 'sourcelink.html', 'searchbox.html', 'versioning.html'] } +# Whitelist pattern for tags (set to None to ignore all tags) +# Will show up in list of Older releases, see _templates/versioning.html +smv_tag_whitelist = r'^.*$' # all tags + +# Whitelist pattern for branches (set to None to ignore all branches) +# Will show up in list of Latest releases, see _templates/versioning.html +smv_branch_whitelist = r'v5.6.1|dev' # r'^.*$' + # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. #html_theme = 'default' From 762fdcfa1d6d253068ce1cefdc5895ff472ca561 Mon Sep 17 00:00:00 2001 From: Randy LeVeque Date: Mon, 6 Apr 2020 10:58:06 -0700 Subject: [PATCH 2/4] some updates to sphinx-multiversion sidebar look --- doc/_templates/versioning.html | 4 ++-- doc/conf.py | 5 +++++ doc/rsync_sampledocs.sh | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/_templates/versioning.html b/doc/_templates/versioning.html index f9b8d48..0b019f5 100644 --- a/doc/_templates/versioning.html +++ b/doc/_templates/versioning.html @@ -1,11 +1,11 @@ {% if versions %} -

{{ _('Latest') }}

+

{{ _('Latest Version') }}

-

{{ _('Older') }}

+

{{ _('Older Versions') }}