From 4f7b663a8f46d9fc453ee9f02b017629a2b751aa Mon Sep 17 00:00:00 2001 From: Gabriel Altay Date: Thu, 21 Mar 2019 17:30:31 -0400 Subject: [PATCH] hack to get sphinx-apidoc to run in readthedocs build --- docs/conf.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 85b4bee..b915035 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -152,3 +152,32 @@ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {"https://docs.python.org/": None} + + +def run_apidoc(_): + 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)