Skip to content

Commit

Permalink
Add required .readthedocs.yaml, conf.py and set sphinx_rtd_theme
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kontura committed Feb 9, 2024
1 parent 1032c2c commit 86654c3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion doc/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sphinx_rtd_theme

0 comments on commit 86654c3

Please sign in to comment.