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.
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
autodoc.FunctionDocumenterwhich renders overloads differently.Methods:
format_signature(**kwargs)Format the function's signature, including those for any overloaded implementations.
add_directive_header(sig)Add the directive's header and options to the generated content.
process_overload_signature(overload)Processes the signature of the given overloaded implementation.
-
format_signature(**kwargs)[source]¶ Format the function’s signature, including those for any overloaded implementations.
- Return type:
- Returns:
The signature(s), as a multi-line string.
-
-
class
MethodDocumenter(directive, name, indent='')[source]¶ Bases:
OverloadMixin,MethodDocumenterCustom
autodoc.MethodDocumenterwhich renders overloads differently.Methods:
format_signature(**kwargs)Format the method's signature, including those for any overloaded implementations.
add_directive_header(sig)Add the directive's header and options to the generated content.
process_overload_signature(overload)Processes the signature of the given overloaded implementation.
-
format_signature(**kwargs)[source]¶ Format the method’s signature, including those for any overloaded implementations.
- Parameters:
kwargs
- Return type:
- Returns:
The signature(s), as a multi-line string.
-
-
setup(app)[source]¶ Setup
sphinx_toolbox.more_autodoc.overloads.- Parameters:
app (
Sphinx) – The Sphinx application.- Return type: