Skip to content

Commit

Permalink
Fixup attempt for rtd run_apidoc wd
Browse files Browse the repository at this point in the history
  • Loading branch information
plstcharles committed Oct 17, 2018
1 parent 969a2d5 commit 43870c4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,19 @@
napoleon_use_rtype = False
napoleon_use_param = False

import os
on_rtd = os.environ.get('READTHEDOCS') == 'True'

def skip(app, what, name, obj, skip, options):
if name == "__init__" or name == "__call__" or name == "__getitem__":
return False
return skip

def run_apidoc(_):
argv = ["-o", "./src/", "../src/"]
if on_rtd:
argv = ["-o", ".", "../../src/"]
else:
argv = ["-o", "./src/", "../src/"]
try:
# Sphinx 1.7+
from sphinx.ext import apidoc
Expand Down

0 comments on commit 43870c4

Please sign in to comment.