Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

Commit

Permalink
Move generation of api-docs from generate-apidoc script to conf.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Sandve Alnæs committed Aug 2, 2016
1 parent 2ac6853 commit 12e92cf
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 330 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/FIAT.egg-info/

/.cache/
/doc/sphinx/source/api-doc
29 changes: 0 additions & 29 deletions doc/sphinx/generate-apidoc

This file was deleted.

294 changes: 0 additions & 294 deletions doc/sphinx/source/api-doc/FIAT.rst

This file was deleted.

7 changes: 0 additions & 7 deletions doc/sphinx/source/api-doc/modules.rst

This file was deleted.

19 changes: 19 additions & 0 deletions doc/sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,22 @@

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'http://docs.python.org/': None}


def run_apidoc(_):
modules = ['FIAT']

# Get location of Sphinx files
sphinx_source_dir = os.path.abspath(os.path.dirname(__file__))
repo_dir = os.path.abspath(os.path.join(sphinx_source_dir, os.path.pardir,
os.path.pardir, os.path.pardir))
apidoc_dir = os.path.join(sphinx_source_dir, "api-doc")

from sphinx.apidoc import main
for module in modules:
# Generate .rst files ready for autodoc
module_dir = os.path.join(repo_dir, module)
main(["-f", "-d", "1", "-o", apidoc_dir, module_dir])

def setup(app):
app.connect('builder-inited', run_apidoc)

0 comments on commit 12e92cf

Please sign in to comment.