Skip to content

Commit

Permalink
Merge pull request #81 from Carreau/rtd
Browse files Browse the repository at this point in the history
Build docs on readthedocs.
  • Loading branch information
minrk committed Jan 8, 2016
2 parents 8b3f0a5 + 51d35de commit b0384f1
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 6 deletions.
10 changes: 7 additions & 3 deletions docs/autogen_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

destination = os.path.join(os.path.dirname(__file__), 'source/config_options.rst')

with open(destination, 'w') as f:
f.write(header)
f.write(JupyterQtConsoleApp().document_config_options())
def main():
with open(destination, 'w') as f:
f.write(header)
f.write(JupyterQtConsoleApp().document_config_options())

if __name__ == '__main__':
main()
12 changes: 12 additions & 0 deletions docs/conda-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: qtconsole_docs
channels:
- asmeurer
dependencies:
- ipykernel
- numpydoc # we seem to not use that, but removing break readthedocs conda (for now)
- pexpect
- pygments
- pyqt
- pip:
- recommonmark # we seem to not use that, but removing break readthedocs conda (for now)
- readthedocs-sphinx-ext # we seem to not use that, but removing break readthedocs conda (for now)
12 changes: 9 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,20 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import shlex

# Check the version information
release_info = {}
exec(compile(open('../../qtconsole/_version.py').read(), '../../qtconsole/_version.py', 'exec'), release_info)

import os
if os.environ.get('READTHEDOCS', None) == 'True':
print('On RTD, regen API')
#from ..autogen_config import main
ns = {'__file__':'../autogen_config.py'}
exec(compile(open('../autogen_config.py').read(), '../autogen_config.py', 'exec'), ns )
ns['main']()


# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand Down
5 changes: 5 additions & 0 deletions readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
conda:
file: docs/conda-env.yml
python:
version: 2
setup_py_install: true

0 comments on commit b0384f1

Please sign in to comment.