From 4bdd3be7695c3a631b91a590485af2eba3a859be Mon Sep 17 00:00:00 2001 From: Fridolin Glatter Date: Tue, 23 Jul 2024 13:57:24 +0200 Subject: [PATCH] Include config changes suggested by RTD --- conf.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/conf.py b/conf.py index ccefaa4..e3a33bc 100644 --- a/conf.py +++ b/conf.py @@ -10,11 +10,10 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # -# import os # import sys # sys.path.insert(0, os.path.abspath('.')) - import datetime +import os # -- Project information ----------------------------------------------------- @@ -38,7 +37,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = [] +exclude_patterns: list[str] = [] # -- Intersphinx ------------------------------------------------------------- @@ -69,10 +68,19 @@ "iiasa.css", ] +# Define the canonical URL if you are using a custom domain on Read the Docs +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": + if "html_context" not in globals(): + html_context = {} + html_context["READTHEDOCS"] = True + # prolog for all rst files rst_prolog = """ .. |br| raw:: html
-""" \ No newline at end of file +"""