class documentation

Directive to describe a class, function or similar object. Not used directly, but subclassed (in domain-specific directives) to add custom behavior.

Method add_target_and_index Add cross-reference IDs and entries to self.indexnode, if applicable.
Method after_content Called after parsing content. Used to reset information about the current directive context on the build environment.
Method before_content Called before parsing content. Used to set information about the current directive context on the build environment.
Method get_field_type_map Undocumented
Method get_signatures Retrieve the signatures to document from the directive arguments. By default, signatures are given as arguments, one per line.
Method handle_signature Parse the signature *sig* into individual nodes and append them to *signode*. If ValueError is raised, parsing is aborted and the whole *sig* is put into a single desc_name node.
Method run Main directive entry function, called by docutils upon encountering the directive.
Method transform_content Called after creating the content through nested parsing, but before the ``object-description-transform`` event is emitted, and before the info-fields are transformed. Can be used to manipulate the content.
Class Variable doc_field_types Undocumented
Class Variable final_argument_whitespace Undocumented
Class Variable has_content Undocumented
Class Variable option_spec Undocumented
Class Variable optional_arguments Undocumented
Class Variable required_arguments Undocumented
Instance Variable domain Undocumented
Instance Variable indexnode Undocumented
Instance Variable names Undocumented
Instance Variable objtype Undocumented
Method _object_hierarchy_parts Returns a tuple of strings, one entry for each part of the object's hierarchy (e.g. ``('module', 'submodule', 'Class', 'method')``). The returned tuple is used to properly nest children within parents in the table of contents, and can also be used within the :py:meth:`_toc_entry_name` method.
Method _toc_entry_name Returns the text of the table of contents entry for the object.
Instance Variable _doc_field_type_map Undocumented

Inherited from SphinxDirective:

Method get_location Get current location info for logging.
Method get_source_info Get source and line number.
Method set_source_info Set source and line number to the node.
Property config Reference to the :class:`.Config` object.
Property env Reference to the :class:`.BuildEnvironment` object.
def add_target_and_index(self, name, sig, signode): (source)

Add cross-reference IDs and entries to self.indexnode, if applicable. *name* is whatever :meth:`handle_signature()` returned.

Parameters
name:TUndocumented
sig:strUndocumented
signode:desc_signatureUndocumented
def after_content(self): (source)

Called after parsing content. Used to reset information about the current directive context on the build environment.

def before_content(self): (source)

Called before parsing content. Used to set information about the current directive context on the build environment.

def get_field_type_map(self): (source)

Undocumented

Returns
dict[str, tuple[Field, bool]]Undocumented
def get_signatures(self): (source)

Retrieve the signatures to document from the directive arguments. By default, signatures are given as arguments, one per line.

Returns
list[str]Undocumented
def handle_signature(self, sig, signode): (source)

Parse the signature *sig* into individual nodes and append them to *signode*. If ValueError is raised, parsing is aborted and the whole *sig* is put into a single desc_name node. The return value should be a value that identifies the object. It is passed to :meth:`add_target_and_index()` unchanged, and otherwise only used to skip duplicates.

Parameters
sig:strUndocumented
signode:desc_signatureUndocumented
Returns
TUndocumented
def run(self): (source)

Main directive entry function, called by docutils upon encountering the directive. This directive is meant to be quite easily subclassable, so it delegates to several additional methods. What it does: * find out if called as a domain-specific directive, set self.domain * create a `desc` node to fit all description inside * parse standard options, currently `noindex` * create an index node if needed as self.indexnode * parse all given signatures (as returned by self.get_signatures()) using self.handle_signature(), which should either return a name or raise ValueError * add index entries using self.add_target_and_index() * parse the content and handle doc fields in it

Returns
list[Node]Undocumented
def transform_content(self, contentnode): (source)

Called after creating the content through nested parsing, but before the ``object-description-transform`` event is emitted, and before the info-fields are transformed. Can be used to manipulate the content.

Parameters
contentnode:addnodes.desc_contentUndocumented
final_argument_whitespace: bool = (source)

Undocumented

has_content: bool = (source)

Undocumented

optional_arguments: int = (source)

Undocumented

required_arguments: int = (source)

Undocumented

indexnode = (source)

Undocumented

def _object_hierarchy_parts(self, sig_node): (source)

Returns a tuple of strings, one entry for each part of the object's hierarchy (e.g. ``('module', 'submodule', 'Class', 'method')``). The returned tuple is used to properly nest children within parents in the table of contents, and can also be used within the :py:meth:`_toc_entry_name` method. This method must not be used outwith table of contents generation.

Parameters
sig_node:desc_signatureUndocumented
Returns
tuple[str, ...]Undocumented
def _toc_entry_name(self, sig_node): (source)

Returns the text of the table of contents entry for the object. This function is called once, in :py:meth:`run`, to set the name for the table of contents entry (a special attribute ``_toc_name`` is set on the object node, later used in ``environment.collectors.toctree.TocTreeCollector.process_doc().build_toc()`` when the table of contents entries are collected). To support table of contents entries for their objects, domains must override this method, also respecting the configuration setting ``toc_object_entries_show_parents``. Domains must also override :py:meth:`_object_hierarchy_parts`, with one (string) entry for each part of the object's hierarchy. The result of this method is set on the signature node, and can be accessed as ``sig_node['_toc_parts']`` for use within this method. The resulting tuple is also used to properly nest children within parents in the table of contents. An example implementations of this method is within the python domain (:meth:`PyObject._toc_entry_name`). The python domain sets the ``_toc_parts`` attribute within the :py:meth:`handle_signature()` method.

Parameters
sig_node:desc_signatureUndocumented
Returns
strUndocumented
_doc_field_type_map: dict = (source)

Undocumented