From e7c5df7eb76a5e54d4f831e80922b5d3274827d4 Mon Sep 17 00:00:00 2001 From: James B Date: Fri, 13 Sep 2024 11:37:39 +0100 Subject: [PATCH] Read the docs config & theme --- .readthedocs.yaml | 9 ++++++--- docs/conf.py | 16 ++++++++++++---- requirements_dev.txt | 2 +- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 475ea97d..293d5d12 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -18,6 +18,9 @@ sphinx: # We recommend specifying your dependencies to enable reproducible builds: # https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html -# python: -# install: -# - requirements: docs/requirements.txt +python: + install: + - requirements: requirements_dev.txt + + + diff --git a/docs/conf.py b/docs/conf.py index c086d4ea..1b002d53 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,11 +17,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 os # import sys # sys.path.insert(0, os.path.abspath('.')) -import sphinx_rtd_theme # -- General configuration ------------------------------------------------ @@ -130,7 +129,7 @@ # a list of builtin themes. # # html_theme = 'alabaster' -html_theme = "sphinx_rtd_theme" +html_theme = "odsc_default_sphinx_theme" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -140,7 +139,6 @@ # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] -html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # The name for this set of Sphinx documents. # " v documentation" by default. @@ -347,3 +345,13 @@ # If true, do not generate a @detailmenu in the "Top" node's menu. # # texinfo_no_detailmenu = False + + +# -- Readthedocs ------------------------------------------- + +# 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 + diff --git a/requirements_dev.txt b/requirements_dev.txt index 0224aa60..c49ce5b9 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -5,7 +5,7 @@ pytest-cov coveralls pytest-localserver sphinx -sphinx_rtd_theme +odsc-default-sphinx-theme isort flake8<6 black==22.3.0