-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy path.readthedocs.yaml
39 lines (36 loc) · 1.69 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
version: 2
formats:
- pdf
- htmlzip
build:
os: ubuntu-22.04
tools:
python: "3.12"
commands:
# Skip docs build if the commit message contains "skip ci"
- (git --no-pager log --pretty="tformat:%s -- %b" -1 | grep -viq "skip ci") || exit 183
# Skip docs build if there are no changes related to docs
- |
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- docs/ .readthedocs.yaml src/mqt/ src/python include/*/python .github/contributing* .github/support*;
then
exit 183;
fi
# Set up uv and a virtual environment
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
# Unshallow the git clone and fetch tags to get proper version information
- git fetch --unshallow --tags
# Run the html builder
- uv run --frozen --no-dev --group docs -m sphinx -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html
# Run the htmlzip builder and create a zip file
- uv run --frozen --no-dev --group docs -m sphinx -T -b dirhtml -d docs/_build/doctrees -D language=en docs docs/_build/dirhtml
- mkdir -p $READTHEDOCS_OUTPUT/htmlzip
- zip -r $READTHEDOCS_OUTPUT/htmlzip/html.zip docs/_build/dirhtml/*
# Run the latex builder and create a pdf file
- uv run --frozen --no-dev --group docs -m sphinx -T -b latex -d docs/_build/doctrees -D language=en docs docs/_build/latex
- cd docs/_build/latex && latexmk -pdf -f -dvi- -ps- -interaction=nonstopmode -jobname=$READTHEDOCS_PROJECT
- mkdir -p $READTHEDOCS_OUTPUT/pdf
- cp docs/_build/latex/$READTHEDOCS_PROJECT.pdf $READTHEDOCS_OUTPUT/pdf/$READTHEDOCS_PROJECT.pdf
sphinx:
configuration: docs/conf.py