From 259e4c9d675a8c2faaeceee8aee3527e5d25ec9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= Date: Fri, 9 Feb 2024 10:01:45 +0100 Subject: [PATCH] Add required `.readthedocs.yaml`, `conf.py` and set `sphinx_rtd_theme` RTD no longer automatically generates config files. The `.readthedocs.yaml` is now required: https://blog.readthedocs.com/migrate-configuration-v2/ The `conf.py` for Sphinx is also required: https://blog.readthedocs.com/doctool-without-configuration-file/ - The previously automatically generated `conf.py` contained `sphinx_rtd_theme` -> in order to keep it we have to set it and add it as a requirement. - The version field in `conf.py.in` remains uncofigured but I don't think it is a problem because it doesn't shows up in the html docs. --- .readthedocs.yaml | 16 ++++++++++++++++ doc/conf.py.in | 2 +- doc/requirements.txt | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .readthedocs.yaml create mode 100644 doc/requirements.txt diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000000..ff8d7abb60 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,16 @@ +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.12" + jobs: + pre_build: + - cp doc/conf.py.in doc/conf.py + +sphinx: + configuration: doc/conf.py + +python: + install: + - requirements: doc/requirements.txt diff --git a/doc/conf.py.in b/doc/conf.py.in index 2add96fd1c..e74c51fdf6 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -94,7 +94,7 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +html_theme = "sphinx_rtd_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 diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 0000000000..483a4e9600 --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1 @@ +sphinx_rtd_theme