diff --git a/.readthedocs.yml b/.readthedocs.yml index 0176c2640..10c21fd8f 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -7,6 +7,10 @@ python: - method: pip path: . +build: + apt_packages: + - inkscape + formats: - epub - pdf diff --git a/doc/en/conf.py b/doc/en/conf.py index 61f9dd5d5..7c053e332 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -17,6 +17,7 @@ # The short X.Y version. import ast import os +import shutil import sys from typing import List from typing import TYPE_CHECKING @@ -57,6 +58,13 @@ extensions = [ "sphinxcontrib_trio", ] +# Building PDF docs on readthedocs requires inkscape for svg to pdf +# conversion. The relevant plugin is not useful for normal HTML builds, but +# it still raises warnings and fails CI if inkscape is not available. So +# only use the plugin if inkscape is actually available. +if shutil.which("inkscape"): + extensions.append("sphinxcontrib.inkscapeconverter") + # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] diff --git a/doc/en/example/fixtures/fixture_availability.svg b/doc/en/example/fixtures/fixture_availability.svg index 3ca28447c..066caac34 100644 --- a/doc/en/example/fixtures/fixture_availability.svg +++ b/doc/en/example/fixtures/fixture_availability.svg @@ -1,4 +1,4 @@ - +