diff --git a/.readthedocs.yml b/.readthedocs.yml index 4b04e1fb..4192147e 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -17,6 +17,8 @@ build: pre_build: - sphinx-apidoc -o docs/apidoc --private --module-first xscen - env SKIP_NOTEBOOKS=1 sphinx-build -b linkcheck docs/ _build/linkcheck +# post_build: +# - rm -rf docs/notebooks/_data conda: environment: environment-dev.yml diff --git a/docs/conf.py b/docs/conf.py index dcee2304..d6ad8631 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -79,11 +79,11 @@ if skip_notebooks: warnings.warn("SKIP_NOTEBOOKS is set. Not executing notebooks.") nbsphinx_execute = "never" -elif os.getenv("READTHEDOCS_VERSION_NAME") in ["latest", "stable"] or os.getenv( - "READTHEDOCS_VERSION_TYPE" -) in ["tag"]: - if os.getenv("READTHEDOCS_OUTPUT") in ["pdf"]: - warnings.warn("Generating PDF version. Not executing notebooks.") +elif (os.getenv("READTHEDOCS_VERSION_NAME") in ["latest", "stable"]) or ( + os.getenv("READTHEDOCS_VERSION_TYPE") in ["tag"] +): + if Path(__file__).parent.joinpath("notebooks/_data").exists(): + warnings.warn("Notebook artefacts found. Not executing notebooks.") nbsphinx_execute = "never" # if skip_notebooks or os.getenv("READTHEDOCS_VERSION_TYPE") in [