Skip to content

Commit

Permalink
Add API docs refs #2, see also readthedocs/readthedocs.org#1139
Browse files Browse the repository at this point in the history
  • Loading branch information
fantix committed Mar 8, 2016
1 parent 178a048 commit 1de64f8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,3 +273,24 @@

# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False


import subprocess


def run_apidoc(_):
modules = ['a_list_of',
'python_module_directories',
'in_your_project']
for module in modules:
cur_dir = os.path.abspath(os.path.dirname(__file__))
output_path = os.path.join(cur_dir, module, 'doc')
cmd_path = 'sphinx-apidoc'
if hasattr(sys, 'real_prefix'): # Check to see if we are in a virtualenv
# If we are, assemble the path manually
cmd_path = os.path.abspath(os.path.join(sys.prefix, 'bin', 'sphinx-apidoc'))
subprocess.check_call([cmd_path, '-e', '-o', output_path, module, '--force'])


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

0 comments on commit 1de64f8

Please sign in to comment.