Fix custom Sphinx formatter for aliased functions

Regression of @99bcf20: Since Sphinx 1.2.1 (commit
sphinx-doc/sphinx@574a796), sphinx.ext.autosummary overwrites custom-set
documenters.
This is not a particularly elegant solution, but none of the events from
sphinx.ext.autodoc allows editing a function's name. Subclassing other
autodoc classes also appears to be quite challenging.
This commit is contained in:
Felix Dreissig 2015-03-29 00:40:29 +01:00
parent fb080b1e2f
commit 0869680435

View file

@ -40,4 +40,10 @@ class SaltFunctionDocumenter(FunctionDocumenter):
def setup(app):
app.add_autodocumenter(SaltFunctionDocumenter)
def add_documenter(app, env, docnames):
app.add_autodocumenter(SaltFunctionDocumenter)
# add_autodocumenter() must be called after the initial setup and the
# 'builder-inited' event, as sphinx.ext.autosummary will restore the
# original documenter on 'builder-inited'
app.connect('env-before-read-docs', add_documenter)