I'm using Sphinx's autodoc plugin to automatically document a set of modules. I have a function that accepts *args
, and I'd like to override the documentation to show the slightly nicer funcname(arg1[, arg2[, ...]])
style that the Python stdlib docs use.
Is it possible to override the autodoc output for a specific function?
It is possible to override a signature by using
autofunction
:However, the function with the overridden signature is not sorted with the other functions pulled in with
automodule
. Using explicitautofunction
directives for every function works around that:Addition
You can also append to the docstring:
To override both signature and docstring, use
function
instead ofautofunction
.Addition 2
The signature can also be overridden by having a signature as the first line of the function docstring. See this answer for details.