forked from pybamm-team/PyBaMM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.readthedocs.yaml
56 lines (51 loc) · 1.82 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
53
54
55
56
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
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.11"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"
jobs:
# Unshallow the git clone otherwise this may cause issues with Sphinx extensions
post_checkout:
- git fetch --unshallow
# Altered PDF build and upload job, attributed to
# https://stackoverflow.com/a/76992101/14001839
# 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