Skip to content

Commit e805412

Browse files
author
Martin Gallo
committed
Workaround for building apidoc
Applying the workaround to allow building apidoc in Sphinx version >1.7 (readthedocs/readthedocs.org#1139)
1 parent 3695a4e commit e805412

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

docs/conf.py

+26-2
Original file line numberDiff line numberDiff line change
@@ -163,5 +163,29 @@
163163

164164

165165
# Automatically build API docs
166-
from sphinx.apidoc import main as apidoc_main
167-
apidoc_main(["-f", "-e", "-M", "-o", "api/", "../pysap"])
166+
def run_apidoc(_):
167+
ignore_paths = [
168+
]
169+
170+
argv = [
171+
"-f",
172+
"-T",
173+
"-e",
174+
"-M",
175+
"-o", "api/",
176+
"../pysap"
177+
] + ignore_paths
178+
179+
try:
180+
# Sphinx 1.7+
181+
from sphinx.ext import apidoc
182+
apidoc.main(argv)
183+
except ImportError:
184+
# Sphinx 1.6 (and earlier)
185+
from sphinx import apidoc
186+
argv.insert(0, apidoc.__file__)
187+
apidoc.main(argv)
188+
189+
190+
def setup(app):
191+
app.connect('builder-inited', run_apidoc)

0 commit comments

Comments
 (0)