diff --git a/doc/conf.py b/doc/conf.py index 495ec9eb..40ee44f1 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -75,9 +75,14 @@ nbsphinx_timeout = 60 # This is processed by Jinja2 and inserted before each notebook +# Some change in dependencies made us need to replace `var` with +# `env.config.html_context['var']`. nbsphinx_prolog = r""" {% set docname = 'doc/' + env.doc2path(env.docname, base=None) %} -{% set git_ref = 'master' if '.' not in env.config.current_version else 'v' + env.config.release %} +{% set git_ref = 'master' if not env.config.html_context['READTHEDOCS'] else + env.config.html_context['github_version'] + if '.' not in env.config.html_context['current_version'] else + 'v' + env.config.release %} .. raw:: html
diff --git a/doc/readthedocs-pip-requirements.txt b/doc/readthedocs-pip-requirements.txt index 2ec91ea2..8196cd85 100644 --- a/doc/readthedocs-pip-requirements.txt +++ b/doc/readthedocs-pip-requirements.txt @@ -10,7 +10,7 @@ scipy ipykernel nbsphinx numba -sphinx_rtd_theme +sphinx_rtd_theme>=0.5.0 sphinx-markdown-tables notedown semantic-version==2.6.0