blark.sphinxdomain.DeclarationDirective

class blark.sphinxdomain.DeclarationDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Bases: BlarkDirective

Methods

handle_signature(sig, signode)

Parse the signature sig into individual nodes and append them to signode.

transform_content(contentnode)

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

Attributes

config

Reference to the Config object.

doc_field_types

domain

env

Reference to the BuildEnvironment object.

final_argument_whitespace

May the final argument contain whitespace?

has_content

May the directive have content?

indexnode

objtype

option_spec

Mapping of option names to validator functions.

optional_arguments

Number of optional arguments after the required arguments.

required_arguments

Number of required directive arguments.

block_header

obj

name

The role name actually used in the document.

rawtext

A string containing the entire interpreted text input.

text

The interpreted text content.

lineno

The line number where the interpreted text begins.

options

A dictionary of directive options for customization ("role" directive).

content

A list of strings, the directive content for customization ("role" directive).

block_header: str
obj: DeclarationSummary
handle_signature(sig: str, signode: desc_signature) Tuple[str, str][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 add_target_and_index() unchanged, and otherwise only used to skip duplicates.

transform_content(contentnode: desc_content) None[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.