diff --git a/docs/autogen_config.py b/docs/autogen_config.py index f84d99113..da5105a55 100644 --- a/docs/autogen_config.py +++ b/docs/autogen_config.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +import os.path from qtconsole.qtconsoleapp import JupyterQtConsoleApp header = """\ @@ -34,6 +35,8 @@ enter:: """ -with open("source/config.rst", 'w') as f: +destination = os.path.join(os.path.dirname(__file__), 'source/config.rst') + +with open(destination, 'w') as f: f.write(header) f.write(JupyterQtConsoleApp().document_config_options()) diff --git a/docs/source/conf.py b/docs/source/conf.py index 15b3927fc..dd3589596 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -22,6 +22,13 @@ import shlex # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) +if os.environ.get('READTHEDOCS', ''): + + # Readthedocs doesn't run our Makefile, so we do this to force it to generate + # the config docs. + with open('../autogen_config.py') as f: + exec(compile(f.read(), '../autogen_config.py', 'exec'), {}) + # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here.