more_autodoc.overloads¶
Documenters for functions and methods which display overloads differently.
New in version 1.4.0.
Enable sphinx_toolbox.more_autodoc.overloads by adding the following
to the extensions variable in your conf.py:
extensions = [
...
'sphinx_toolbox.more_autodoc.overloads',
]
For more information see https://www.sphinx-doc.org/en/master/usage/extensions#third-party-extensions .
Configuration¶
- overloads_location¶
- Type:
strDefault:'signature'The location to display overloads at:
'signature'– Display overloads above the function signature.'top'– Display overloads at the top of the docstring, immediately below the signature.'bottom'– Display overloads at the bottom of the docstring, or immediately below the return type.
API Reference¶
Classes:
|
Custom |
|
Custom |
Mixin class for function and class documenters that changes the appearance of overloaded functions. |
Functions:
|
- class OverloadMixin[source]¶
Bases:
objectMixin class for function and class documenters that changes the appearance of overloaded functions.
New in version 1.4.0.
Methods:
Create the overloaded implementations for insertion into to the body of the documenter’s output.
process_overload_signature(overload)Processes the signature of the given overloaded implementation.
add_content(more_content[, no_docstring])Add content from docstrings, attribute documentation and the user.
- create_body_overloads()[source]¶
Create the overloaded implementations for insertion into to the body of the documenter’s output.
- Return type
- class FunctionDocumenter(directive, name, indent='')[source]¶
Bases:
OverloadMixin,FunctionDocumenterCustom
sphinx.ext.autodoc.FunctionDocumenterwhich renders overloads differently.New in version 1.4.0.
Methods:
format_signature(**kwargs)Format the function’s signature, including those for any overloaded implementations.
add_directive_header(sig)Add the directive’s header.
process_overload_signature(overload)Processes the signature of the given overloaded implementation.
- class MethodDocumenter(directive, name, indent='')[source]¶
Bases:
OverloadMixin,MethodDocumenterCustom
sphinx.ext.autodoc.MethodDocumenterwhich renders overloads differently.New in version 1.4.0.
Methods:
format_signature(**kwargs)Format the method’s signature, including those for any overloaded implementations.
add_directive_header(sig)Add the directive’s header.
process_overload_signature(overload)Processes the signature of the given overloaded implementation.
- setup(app)[source]¶
Setup
sphinx_toolbox.more_autodoc.overloads.New in version 1.4.0.
- Parameters
app (
Sphinx) – The Sphinx application.- Return type