more_autodoc.genericalias

Documenter for alias, which usually manifest as type aliases.

New in version 0.6.0.

Enable sphinx_toolbox.more_autodoc.genericalias by adding the following to the extensions variable in your conf.py:

extensions = [
    ...
    'sphinx_toolbox.more_autodoc.genericalias',
    ]

For more information see https://www.sphinx-doc.org/en/master/usage/extensions#third-party-extensions .

Note

sphinx_toolbox.more_autodoc.genericalias is only supported on Python 3.7 and above.

class PrettyGenericAliasDocumenter(directive, name, indent='')[source]

Bases: DataDocumenter

Specialized Documenter subclass for GenericAliases, with prettier output than Sphinx’s one.

add_content(more_content, no_docstring=False)[source]

Add the autodocumenter content.

Parameters
add_directive_header(sig)[source]

Add the directive header and options to the generated content.

classmethod can_document_member(member, membername, isattr, parent)[source]

Called to see if a member can be documented by this documenter.

Return type

bool

setup(app)[source]

Setup sphinx_toolbox.more_autodoc.genericalias.

Parameters

app (Sphinx) – The Sphinx application.

Return type

SphinxExtMetadata