package documentation

sphinx.ext.autosummary ~~~~~~~~~~~~~~~~~~~~~~ Sphinx extension that adds an autosummary:: directive, which can be used to generate function/method/attribute/etc. summary lists, similar to those output eg. by Epydoc and other API doc generation tools. An :autolink: role is also provided. autosummary directive --------------------- The autosummary directive has the form:: .. autosummary:: :nosignatures: :toctree: generated/ module.function_1 module.function_2 ... and it generates an output table (containing signatures, optionally) ======================== ============================================= module.function_1(args) Summary line from the docstring of function_1 module.function_2(args) Summary line from the docstring ... ======================== ============================================= If the :toctree: option is specified, files matching the function names are inserted to the toctree with the given prefix: generated/module.function_1 generated/module.function_2 ... Note: The file names contain the module:: or currentmodule:: prefixes. .. seealso:: autosummary_generate.py autolink role ------------- The autolink role functions as ``:obj:`` when the name referred can be resolved to a Python object, and otherwise it becomes simple emphasis. This can be used as the default role to make links 'smart'. :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details.

Unknown Field: copyright
Copyright 2007-2022 by the Sphinx team, see AUTHORS.
Unknown Field: license
BSD, see LICENSE for details.
Module generate sphinx.ext.autosummary.generate ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From __init__.py:

Constant WELL​_KNOWN​_ABBREVIATIONS Undocumented
Variable literal​_re Undocumented
Variable logger Undocumented
Variable periods​_re Undocumented
Class ​Auto​Link Smart linking role.
Class ​Autosummary Pretty table containing short signatures and summaries of functions etc.
Class autosummary​_table Undocumented
Class autosummary​_toc Undocumented
Class ​Fake​Application Undocumented
Class ​Fake​Directive Undocumented
Class ​Import​Exception​Group Exceptions raised during importing the target objects.
Function ​_cleanup​_signature Clean up signature using inspect.signautre() for mangle_signature()
Function ​_import​_by​_name Import a Python object given its full name.
Function autosummary​_noop Undocumented
Function autosummary​_table​_visit​_html Make the first column of the table non-breaking.
Function autosummary​_toc​_visit​_html Hide autosummary toctree list in HTML output.
Function extract​_summary Extract summary from docstring.
Function get​_documenter Get an autodoc.Documenter class suitable for documenting the given object.
Function get​_import​_prefixes​_from​_env Obtain current Python import prefixes (for import_by_name) from document.env
Function get​_rst​_suffix Undocumented
Function import​_by​_name Import a Python object that has the given name, under one of the prefixes. The first name that succeeds is used.
Function import​_ivar​_by​_name Import an instance variable that has the given name, under one of the prefixes. The first name that succeeds is used.
Function limited​_join Join a number of strings into one, limiting the length to max_chars.
Function mangle​_signature Reformat a function signature to a more compact form.
Function process​_autosummary​_toc Insert items described in autosummary:: to the TOC tree, but do not generate the toctree:: list.
Function process​_generate​_options Undocumented
Function setup Undocumented
Function strip​_arg​_typehint Strip a type hint from argument definition.
logger =

Undocumented

periods_re =

Undocumented

literal_re =

Undocumented

WELL_KNOWN_ABBREVIATIONS: tuple[str, ...] =

Undocumented

Value
('et al.', ' i.e.')
def process_autosummary_toc(app, doctree):
Insert items described in autosummary:: to the TOC tree, but do not generate the toctree:: list.
Parameters
app:SphinxUndocumented
doctree:nodes.documentUndocumented
def autosummary_toc_visit_html(self, node):
Hide autosummary toctree list in HTML output.
Parameters
node:autosummary_tocUndocumented
def autosummary_noop(self, node):

Undocumented

Parameters
node:NodeUndocumented
def autosummary_table_visit_html(self, node):
Make the first column of the table non-breaking.
Parameters
node:autosummary_tableUndocumented
def get_documenter(app, obj, parent):

Get an autodoc.Documenter class suitable for documenting the given object.

obj is the Python object to be documented, and parent is an another Python object (e.g. a module or a class) to which obj belongs to.

Parameters
app:SphinxUndocumented
obj:AnyUndocumented
parent:AnyUndocumented
Returns
Type[Documenter]Undocumented
def strip_arg_typehint(s):
Strip a type hint from argument definition.
Parameters
s:strUndocumented
Returns
strUndocumented
def _cleanup_signature(s):
Clean up signature using inspect.signautre() for mangle_signature()
Parameters
s:strUndocumented
Returns
strUndocumented
def mangle_signature(sig, max_chars=30):
Reformat a function signature to a more compact form.
Parameters
sig:strUndocumented
max​_chars:intUndocumented
Returns
strUndocumented
def extract_summary(doc, document):
Extract summary from docstring.
Parameters
doc:List[str]Undocumented
document:AnyUndocumented
Returns
strUndocumented
def limited_join(sep, items, max_chars=30, overflow_marker='...'):

Join a number of strings into one, limiting the length to max_chars.

If the string overflows this limit, replace the last fitting item by overflow_marker.

Returns: joined_string

Parameters
sep:strUndocumented
items:List[str]Undocumented
max​_chars:intUndocumented
overflow​_marker:strUndocumented
Returns
strUndocumented
def get_import_prefixes_from_env(env):
Obtain current Python import prefixes (for import_by_name) from document.env
Parameters
env:BuildEnvironmentUndocumented
Returns
List[str]Undocumented
def import_by_name(name, prefixes=[None], grouped_exception=False):
Import a Python object that has the given name, under one of the prefixes. The first name that succeeds is used.
Parameters
name:strUndocumented
prefixes:List[str]Undocumented
grouped​_exception:boolUndocumented
Returns
Tuple[str, Any, Any, str]Undocumented
def _import_by_name(name, grouped_exception=False):
Import a Python object given its full name.
Parameters
name:strUndocumented
grouped​_exception:boolUndocumented
Returns
Tuple[Any, Any, str]Undocumented
def import_ivar_by_name(name, prefixes=[None], grouped_exception=False):
Import an instance variable that has the given name, under one of the prefixes. The first name that succeeds is used.
Parameters
name:strUndocumented
prefixes:List[str]Undocumented
grouped​_exception:boolUndocumented
Returns
Tuple[str, Any, Any, str]Undocumented
def get_rst_suffix(app):

Undocumented

Parameters
app:SphinxUndocumented
Returns
strUndocumented
def process_generate_options(app):

Undocumented

Parameters
app:SphinxUndocumented
def setup(app):

Undocumented

Parameters
app:SphinxUndocumented
Returns
Dict[str, Any]Undocumented