forked from pybamm-team/PyBaMM
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.readthedocs.yaml
46 lines (42 loc) · 1.51 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
version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
configuration: docs/conf.py
fail_on_warning: false
# PDF builds are disabled here because they are built in a custom fashion
# by extending the RTD build process, see below
formats:
- epub
- htmlzip
# Set the version of Python and other tools you might need
build:
# Install Graphviz to build SVG files
apt_packages:
- "graphviz"
os: ubuntu-22.04
tools:
python: "3.12"
jobs:
# Unshallow the git clone otherwise this may cause issues with Sphinx extensions
post_checkout:
- git fetch --unshallow
# Altered PDF build and upload job
# This also runs on PR builds, but does not upload the PDF
post_build:
- mkdir --parents $READTHEDOCS_OUTPUT/pdf/
# Generate LaTeX files in docs/build/ and doctrees in docs/_build/doctrees, skipping notebooks
- python -m sphinx -T -E -b latex -d docs/_build/doctrees -D language=en docs docs/build/
- cd docs/build/ && cat latexmkrc
# Map non-zero exit codes to zero
- cd docs/build/ && latexmk -r latexmkrc -pdf -f -dvi- -ps- -jobname=pybamm -interaction=nonstopmode || true
- test -f docs/build/pybamm.pdf && echo "pybamm.pdf exists. Copying source file to $READTHEDOCS_OUTPUT/pdf/."
- cp "docs/build/pybamm.pdf" $READTHEDOCS_OUTPUT/pdf/
# Optionally declare the Python requirements required to build your docs
python:
install:
- method: pip
path: .
extra_requirements:
- docs
- all