Skip to content

Commit

Permalink
Merge pull request #2 from jakirkham/fix_rtd
Browse files Browse the repository at this point in the history
Add a fix for ReadTheDocs
  • Loading branch information
jakirkham committed Aug 3, 2018
2 parents 5ae6691 + 8bc8f20 commit 28fdb2f
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,27 +280,30 @@
#texinfo_no_detailmenu = False


# Run sphinx-apidoc before building docs.
def run_apidoc(_):
import sphinx.apidoc

ignore_paths = [
"../setup.py",
"../tests",
"../travis_pypi_setup.py",
"../versioneer.py"
...
]
sphinx.apidoc.main(
[
sphinx.apidoc.__file__,
"-f",
"-T",
"-e",
"-M",
"-o", ".",
".."
] + ignore_paths
)

argv = [
"-f",
"-T",
"-e",
"-M",
"-o", ".",
".."
] + ignore_paths

try:
# Sphinx 1.7+
from sphinx.ext import apidoc
except ImportError:
# Sphinx 1.6 (and earlier)
from sphinx import apidoc
argv.insert(0, apidoc.__file__)

apidoc.main(argv)


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

0 comments on commit 28fdb2f

Please sign in to comment.