-
Notifications
You must be signed in to change notification settings - Fork 4
/
.readthedocs.yaml
52 lines (42 loc) · 1.77 KB
/
.readthedocs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2
build:
os: ubuntu-20.04
tools:
python: "3.9"
commands:
# install fabsetup and devel dependencies including sphinx tools
- pip3.9 install --upgrade -e .[devel]
# enable commands sphinx-apidoc and sphinx-build
- asdf reshim
# apply same steps as described in docs/development.md
# include README
- ln -s ../README.md docs/
# update api docs structure
- rm -rf docs/api && sphinx-apidoc -o docs/api --module-first fabsetup
# apply tweaks
# commands syntax needs to be different
# cf. https://github.com/readthedocs/readthedocs.org/issues/9397
- sed -i "/Submodules/{ N; s/.*----------//; }" docs/api/fabsetup.fabutils.rst
- sed -i "/Submodules/{ N; s/.*----------//; }" docs/api/fabsetup.rst
- sed -i "/Submodules/{ N; s/.*----------//; }" docs/api/fabsetup.utils.rst
- sed -i "s/fabsetup package/fabsetup API/" docs/api/fabsetup.rst
- sed -i "s/Subpackages/Submodules/" docs/api/fabsetup.rst
- sed -i "s/ package$//" docs/api/fabsetup.fabutils.rst
- sed -i "s/ package$//" docs/api/fabsetup.utils.rst
- sed -i "s/ module$//g" docs/api/fabsetup.fabutils.rst
- sed -i "s/ module$//g" docs/api/fabsetup.rst
- sed -i "s/ module$//g" docs/api/fabsetup.utils.rst
- rm docs/api/modules.rst
# run sphinx
- cd docs && make clean html; cd ..
# create symlink for readthedocs upload
- ln -s docs/_build/ _readthedocs
# inspect dirs for debugging in case of build errors
- ls -ahl docs/_build || true
- ls -ahl docs/_build/html || true
- ls -ahl _readthedocs || true
- ls -ahl _readthedocs/ || true
- ls -ahl _readthedocs/html || true
- pwd