mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
parent
fb080b1e2f
commit
0869680435
1 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue