Implement @takluyver's magic RTD executor 💀

This commit is contained in:
Jonathan Frederic 2015-06-02 11:04:20 -07:00
parent 38c6fffd8d
commit 1e7c865cba
2 changed files with 11 additions and 1 deletions

View File

@ -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())

View File

@ -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.