From 4a842ffaaad2f5d829069ca2d4212eb272741fa9 Mon Sep 17 00:00:00 2001 From: Shihab Shahriar Khan Date: Mon, 9 Oct 2023 13:28:56 -0400 Subject: [PATCH] WIP: Adding docs #3 --- docs/sphinx/conf.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/docs/sphinx/conf.py b/docs/sphinx/conf.py index 213ccc2..3a2c2f3 100644 --- a/docs/sphinx/conf.py +++ b/docs/sphinx/conf.py @@ -14,11 +14,24 @@ # import sys # sys.path.insert(0, os.path.abspath('.')) -import subprocess -return_code = subprocess.call('cd .. ; doxygen', shell=True) - -if return_code != 0: - raise RuntimeError('Doxygen failed with return code {0}'.format(return_code)) +import subprocess, os + +# 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: + print('Running on Read the Docs..') + return_code = subprocess.call('cd .. ; doxygen', shell=True) + if return_code != 0: + raise RuntimeError('Doxygen failed with return code {0}'.format(return_code)) + # make sure output directory exists + files = os.listdir('../build/html') + print('Files in ../build/html:') + print('\n'.join(files)) +else: + print('Not running on Read the Docs..') + +subprocess.call('touch *.rst', shell=True) # -- Project information -----------------------------------------------------