diff --git a/docs/source/conf.py b/docs/source/conf.py index 26a16881..cd0fad2b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -67,7 +67,8 @@ author = u'Project Jupyter team' # built documents. # Project Jupyter uses the following to autopopulate version from os.path import dirname -root = dirname(dirname(dirname(__file__))) +docs = dirname(dirname(__file__)) +root = dirname(docs) sys.path.insert(0, root) import jupyterhub @@ -382,5 +383,8 @@ if not on_rtd: # only import and set the theme if we're building docs locally import sphinx_rtd_theme html_theme = 'sphinx_rtd_theme' html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] - +else: + # build rest-api, since RTD doesn't run make + from subprocess import check_call as sh + sh(['make', 'rest-api'], cwd=docs) # otherwise, readthedocs.org uses their theme by default, so no need to specify it