diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 000000000..a054a8c25 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,17 @@ +version: 2 + +build: + os: "ubuntu-20.04" + tools: + python: "3.10" + nodejs: "14" + +sphinx: + configuration: docs/conf.py + +python: + install: + - method: pip + path: . + extra_requirements: + - doc diff --git a/docs/conf.py b/docs/conf.py index 34da4fd47..e3068fc21 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -4,6 +4,7 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html import os +import subprocess import sys # add the demo python code to the path, so that it can be used to demonstrate @@ -87,3 +88,13 @@ "!" ) } + +# Generate JS/CSS assets before running Sphinx on Read the Docs +if os.environ.get("READTHEDOCS") == "True": + subprocess.run( + [ + "npx", + "gulp", + "build", + ] + )