From 11953f7158dab14e0788b176401d3116813ad720 Mon Sep 17 00:00:00 2001 From: Genevieve Buckley <30920819+GenevieveBuckley@users.noreply.github.com> Date: Wed, 17 Jul 2024 16:13:34 +1000 Subject: [PATCH 1/3] Update conf.py, sphinx context injection deprecated in ReadTheDocs ReadTheDocs is deprecating sphinx context injection. See details at https://github.com/dask/dask-image/issues/382 --- docs/conf.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 52af4160..a33e177d 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -120,6 +120,13 @@ # -- Options for HTML output ------------------------------------------- +# Set canonical URL from the Read the Docs Domain +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") + +# Tell Jinja2 templates the build is running on Read the Docs +if os.environ.get("READTHEDOCS", "") == "True": + html_context["READTHEDOCS"] = True + # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'dask_sphinx_theme' From 5ac8da6a114a086d61b9b770c5e165fe5e51286e Mon Sep 17 00:00:00 2001 From: Genevieve Buckley <30920819+GenevieveBuckley@users.noreply.github.com> Date: Wed, 7 Aug 2024 15:01:22 +1000 Subject: [PATCH 2/3] Update docs/conf.py, define html_context variable Co-authored-by: jakirkham --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index a33e177d..f8059226 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -123,6 +123,7 @@ # Set canonical URL from the Read the Docs Domain html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") +html_context = {} # Tell Jinja2 templates the build is running on Read the Docs if os.environ.get("READTHEDOCS", "") == "True": html_context["READTHEDOCS"] = True From 82497e82f21d5a2cd6652dcce929160c905f745d Mon Sep 17 00:00:00 2001 From: jakirkham Date: Wed, 25 Sep 2024 19:59:35 -0700 Subject: [PATCH 3/3] Handle already defined `html_context` --- docs/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index f8059226..d5fa39ef 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -123,9 +123,10 @@ # Set canonical URL from the Read the Docs Domain html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") -html_context = {} # Tell Jinja2 templates the build is running on Read the Docs if os.environ.get("READTHEDOCS", "") == "True": + if "html_context" not in globals(): + html_context = {} html_context["READTHEDOCS"] = True # The theme to use for HTML and HTML Help pages. See the documentation for