diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 000000000..9d3234b26 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,34 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.10" + # You can also specify other tool versions: + # nodejs: "19" + # rust: "1.64" + # golang: "1.19" + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + configuration: doc/source/conf.py + +# Optionally build your docs in additional formats such as PDF and ePub +# formats: +# - pdf +# - epub + +# Optional but recommended, declare the Python requirements required +# to build your documentation +# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - requirements: requirements.txt + - requirements: doc/requirements.txt + diff --git a/doc/source/conf.py b/doc/source/conf.py index 381b97d50..ec357e658 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -11,9 +11,19 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. # from pathlib import Path -import sys +import sys, os -sys.path.append(str(Path.cwd().parent.parent.resolve())) +# Check if we're running on Read the Docs' servers +read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True' + +if read_the_docs_build: + cwd = os.getcwd() + print(cwd) + opencsp_path = cwd + "/../" + "../" + os.listdir(Path(opencsp_path)) + sys.path.append(str(opencsp_path)) +else: + sys.path.append(str(Path.cwd().parent.parent.resolve())) # -- Project information -----------------------------------------------------