Skip to content

Commit f72b9e9

Browse files
committed
🔧 Use docs:build in readthedocs
1 parent c85d7cd commit f72b9e9

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

.readthedocs.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ version: 2
77
build:
88
os: ubuntu-22.04
99
tools:
10-
python: "3.11"
11-
12-
sphinx:
13-
configuration: docs/source/conf.py
10+
python: "3.12"
11+
commands:
12+
- pip install hatch
13+
- hatch run docs:rtd
14+
- pwd
15+
- echo "$READTHEDOCS_OUTPUT"
16+
# - ls -alh docs/build/html/
17+
# - ls -alh $READTHEDOCS_OUTPUT/html/
18+
# - mv docs/build/html/* $READTHEDOCS_OUTPUT/html/
1419

1520
formats:
1621
- htmlzip
1722
- pdf
18-
19-
python:
20-
install:
21-
- requirements: docs/requirements.txt

pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ dependencies = [
7777
]
7878

7979
[tool.hatch.envs.docs.scripts]
80-
build = [
81-
# Treat warnings as errors
82-
"make -C docs html SPHINXOPTS='-W'"
80+
build = "sphinx-build -M html -W docs/ docs/build/"
81+
rtd = [
82+
# The readthedocs build needs to also generate PDFs
83+
"sphinx-build -M html -W docs/source _readthedocs/html/",
84+
"sphinx-build -M latexpdf -W docs/source _readthedocs/pdf/",
8385
]
8486

8587
[tool.hatch.envs.lint]

0 commit comments

Comments
 (0)