Skip to content
Snippets Groups Projects
Commit 1988c067 authored by Ian Bell's avatar Ian Bell
Browse files

Autogenerate the API documentation

parent 1638c830
No related branches found
No related tags found
No related merge requests found
......@@ -28,20 +28,25 @@ import teqp
release = teqp.__version__
# -- Exeucute all notebooks --------------------------------------------------
subprocess.check_output(f'jupyter nbconvert --version', shell=True)
# subprocess.check_output(f'jupyter nbconvert --version', shell=True)
for path, dirs, files in os.walk('.'):
for file in files:
if file.endswith('.ipynb') and '.ipynb_checkpoints' not in path:
subprocess.check_output(f'jupyter nbconvert --to notebook --output {file} --execute {file}', shell=True, cwd=path)
# --ExecutePreprocessor.allow_errors=True (this allows you to allow errors globally, but a raises-exception cell tag is better)
### -- Auto-generate API documentation -----------------------------------------
here = os.path.dirname(__file__)
subprocess.check_output(f'sphinx-apidoc -e -f -o source/api {os.path.dirname(teqp.__file__)}', shell=True, cwd=here)
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'nbsphinx'
'nbsphinx',
'sphinx.ext.autodoc'
]
# Add any paths that contain templates here, relative to this directory.
......
......@@ -9,6 +9,7 @@ Welcome to teqp's documentation!
models/index
derivs/index
algorithms/index
api
Indices and tables
==================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment