class documentation

class StandardDomain(Domain):

View In Hierarchy

Domain for all objects that don't fit into another domain or are added via the application interface.
Method __init__ Undocumented
Method ​_note​_term Note a term for cross reference.
Method ​_resolve​_doc​_xref Undocumented
Method ​_resolve​_keyword​_xref Undocumented
Method ​_resolve​_numref​_xref Undocumented
Method ​_resolve​_obj​_xref Undocumented
Method ​_resolve​_option​_xref Undocumented
Method ​_resolve​_ref​_xref Undocumented
Method ​_resolve​_term​_xref Undocumented
Method add​_object Undocumented
Method add​_program​_option Undocumented
Method build​_reference​_node Undocumented
Method clear​_doc Remove traces of a document in the domain-specific inventories.
Method get​_enumerable​_node​_type Get type of enumerable nodes.
Method get​_fignumber Undocumented
Method get​_full​_qualified​_name Return full qualified name for given node.
Method get​_numfig​_title Get the title of enumerable nodes to refer them using its title
Method get​_objects Return an iterable of "object descriptions".
Method get​_type​_name Return full name for given ObjType.
Method is​_enumerable​_node Undocumented
Method merge​_domaindata Merge in data regarding docnames from a different domaindata inventory (coming from a subprocess in parallel builds).
Method note​_hyperlink​_target Add a hyperlink target for cross reference.
Method note​_object Note a generic object for cross reference.
Method process​_doc Process a document after it is read by the environment.
Method resolve​_any​_xref Resolve the pending_xref node with the given target.
Method resolve​_xref Resolve the pending_xref node with the given typ and target.
Class Variable dangling​_warnings Undocumented
Class Variable directives Undocumented
Class Variable initial​_data Undocumented
Class Variable label Undocumented
Class Variable name Undocumented
Class Variable object​_types Undocumented
Class Variable roles Undocumented
Instance Variable enumerable​_nodes Undocumented
Property ​_terms

Note

Will be removed soon. internal use only.

Property anonlabels Undocumented
Property labels Undocumented
Property objects Undocumented
Property progoptions Undocumented

Inherited from Domain:

Method add​_object​_type Add an object type.
Method check​_consistency Do consistency checks (experimental).
Method directive Return a directive adapter class that always gives the registered directive its full name ('domain:name') as self.name.
Method process​_field​_xref Process a pending xref created in a doc field. For example, attach information about the current scope.
Method role Return a role adapter function that always gives the registered role its full name ('domain:name') as the first argument.
Method setup Set up domain object.
Class Variable data​_version Undocumented
Instance Variable data Undocumented
Instance Variable indices Undocumented
Instance Variable ​_directive​_cache Undocumented
Instance Variable ​_role2type Undocumented
Instance Variable ​_role​_cache Undocumented
Instance Variable ​_type2role Undocumented
Instance Variable env Undocumented
Instance Variable objtypes​_for​_role Undocumented
Instance Variable role​_for​_objtype Undocumented
def __init__(self, env):

Undocumented

Parameters
env:BuildEnvironmentUndocumented
def _note_term(self, term, labelid, location=None):

Note a term for cross reference.

Note

Will be removed soon. internal use only.

Parameters
term:strUndocumented
labelid:strUndocumented
location:AnyUndocumented
def _resolve_doc_xref(self, env, fromdocname, builder, typ, target, node, contnode):

Undocumented

Parameters
env:BuildEnvironmentUndocumented
fromdocname:strUndocumented
builder:BuilderUndocumented
typ:strUndocumented
target:strUndocumented
node:pending_xrefUndocumented
contnode:ElementUndocumented
Returns
Optional[Element]Undocumented
def _resolve_keyword_xref(self, env, fromdocname, builder, typ, target, node, contnode):

Undocumented

Parameters
env:BuildEnvironmentUndocumented
fromdocname:strUndocumented
builder:BuilderUndocumented
typ:strUndocumented
target:strUndocumented
node:pending_xrefUndocumented
contnode:ElementUndocumented
Returns
Optional[Element]Undocumented
def _resolve_numref_xref(self, env, fromdocname, builder, typ, target, node, contnode):

Undocumented

Parameters
env:BuildEnvironmentUndocumented
fromdocname:strUndocumented
builder:BuilderUndocumented
typ:strUndocumented
target:strUndocumented
node:pending_xrefUndocumented
contnode:ElementUndocumented
Returns
Optional[Element]Undocumented
def _resolve_obj_xref(self, env, fromdocname, builder, typ, target, node, contnode):

Undocumented

Parameters
env:BuildEnvironmentUndocumented
fromdocname:strUndocumented
builder:BuilderUndocumented
typ:strUndocumented
target:strUndocumented
node:pending_xrefUndocumented
contnode:ElementUndocumented
Returns
Optional[Element]Undocumented
def _resolve_option_xref(self, env, fromdocname, builder, typ, target, node, contnode):

Undocumented

Parameters
env:BuildEnvironmentUndocumented
fromdocname:strUndocumented
builder:BuilderUndocumented
typ:strUndocumented
target:strUndocumented
node:pending_xrefUndocumented
contnode:ElementUndocumented
Returns
Optional[Element]Undocumented
def _resolve_ref_xref(self, env, fromdocname, builder, typ, target, node, contnode):

Undocumented

Parameters
env:BuildEnvironmentUndocumented
fromdocname:strUndocumented
builder:BuilderUndocumented
typ:strUndocumented
target:strUndocumented
node:pending_xrefUndocumented
contnode:ElementUndocumented
Returns
Optional[Element]Undocumented
def _resolve_term_xref(self, env, fromdocname, builder, typ, target, node, contnode):

Undocumented

Parameters
env:BuildEnvironmentUndocumented
fromdocname:strUndocumented
builder:BuilderUndocumented
typ:strUndocumented
target:strUndocumented
node:pending_xrefUndocumented
contnode:ElementUndocumented
Returns
ElementUndocumented
def add_object(self, objtype, name, docname, labelid):

Undocumented

Parameters
objtype:strUndocumented
name:strUndocumented
docname:strUndocumented
labelid:strUndocumented
def add_program_option(self, program, name, docname, labelid):

Undocumented

Parameters
program:strUndocumented
name:strUndocumented
docname:strUndocumented
labelid:strUndocumented
def build_reference_node(self, fromdocname, builder, docname, labelid, sectname, rolename, **options):

Undocumented

Parameters
fromdocname:strUndocumented
builder:BuilderUndocumented
docname:strUndocumented
labelid:strUndocumented
sectname:strUndocumented
rolename:strUndocumented
**options:AnyUndocumented
Returns
ElementUndocumented
def clear_doc(self, docname):
Remove traces of a document in the domain-specific inventories.
Parameters
docname:strUndocumented
def get_enumerable_node_type(self, node):
Get type of enumerable nodes.
Parameters
node:NodeUndocumented
Returns
Optional[str]Undocumented
def get_fignumber(self, env, builder, figtype, docname, target_node):

Undocumented

Parameters
env:BuildEnvironmentUndocumented
builder:BuilderUndocumented
figtype:strUndocumented
docname:strUndocumented
target​_node:ElementUndocumented
Returns
Tuple[int, ...]Undocumented
def get_full_qualified_name(self, node):
Return full qualified name for given node.
Parameters
node:ElementUndocumented
Returns
Optional[str]Undocumented
def get_numfig_title(self, node):
Get the title of enumerable nodes to refer them using its title
Parameters
node:NodeUndocumented
Returns
Optional[str]Undocumented
def get_objects(self):

Return an iterable of "object descriptions".

Object descriptions are tuples with six items:

name
Fully qualified name.
dispname
Name to display when searching/linking.
type
Object type, a key in self.object_types.
docname
The document where it is to be found.
anchor
The anchor name for the object.
priority

How "important" the object is (determines placement in search results). One of:

1
Default priority (placed before full-text matches).
0
Object is important (placed before default-priority objects).
2
Object is unimportant (placed after full-text matches).
-1
Object should not show up in search at all.
Returns
Iterator[Tuple[str, str, str, str, str, int]]Undocumented
def get_type_name(self, type, primary=False):
Return full name for given ObjType.
Parameters
type:ObjTypeUndocumented
primary:boolUndocumented
Returns
strUndocumented
def is_enumerable_node(self, node):

Undocumented

Parameters
node:NodeUndocumented
Returns
boolUndocumented
def merge_domaindata(self, docnames, otherdata):
Merge in data regarding docnames from a different domaindata inventory (coming from a subprocess in parallel builds).
Parameters
docnames:List[str]Undocumented
otherdata:DictUndocumented
def note_hyperlink_target(self, name, docname, node_id, title=''):

Add a hyperlink target for cross reference.

Warning

This is only for internal use. Please don't use this from your extension. document.note_explicit_target() or note_implicit_target() are recommended to add a hyperlink target to the document.

This only adds a hyperlink target to the StandardDomain. And this does not add a node_id to node. Therefore, it is very fragile to calling this without understanding hyperlink target framework in both docutils and Sphinx.

New in version 3.0.
Parameters
name:strUndocumented
docname:strUndocumented
node​_id:strUndocumented
title:strUndocumented
def note_object(self, objtype, name, labelid, location=None):

Note a generic object for cross reference.

New in version 3.0.
Parameters
objtype:strUndocumented
name:strUndocumented
labelid:strUndocumented
location:AnyUndocumented
def process_doc(self, env, docname, document):
Process a document after it is read by the environment.
Parameters
env:BuildEnvironmentUndocumented
docname:strUndocumented
document:nodes.documentUndocumented
def resolve_any_xref(self, env, fromdocname, builder, target, node, contnode):

Resolve the pending_xref node with the given target.

The reference comes from an "any" or similar role, which means that we don't know the type. Otherwise, the arguments are the same as for resolve_xref.

The method must return a list (potentially empty) of tuples ('domain:role', newnode), where 'domain:role' is the name of a role that could have created the same reference, e.g. 'py:func'. newnode is what resolve_xref would return.

New in version 1.3.
Parameters
env:BuildEnvironmentUndocumented
fromdocname:strUndocumented
builder:BuilderUndocumented
target:strUndocumented
node:pending_xrefUndocumented
contnode:ElementUndocumented
Returns
List[Tuple[str, Element]]Undocumented
def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):

Resolve the pending_xref node with the given typ and target.

This method should return a new node, to replace the xref node, containing the contnode which is the markup content of the cross-reference.

If no resolution can be found, None can be returned; the xref node will then given to the :event:`missing-reference` event, and if that yields no resolution, replaced by contnode.

The method can also raise sphinx.environment.NoUri to suppress the :event:`missing-reference` event being emitted.

Parameters
env:BuildEnvironmentUndocumented
fromdocname:strUndocumented
builder:BuilderUndocumented
typ:strUndocumented
target:strUndocumented
node:pending_xrefUndocumented
contnode:ElementUndocumented
Returns
Optional[Element]Undocumented
dangling_warnings: dict[str, str] =
directives: Dict[str, Type[Directive]] =

Undocumented

initial_data =

Undocumented

label: str =

Undocumented

name: str =

Undocumented

object_types: Dict[str, ObjType] =

Undocumented

roles: Dict[str, Union[RoleFunction, XRefRole]] =

Undocumented

enumerable_nodes =
@property
_terms: Dict[str, Tuple[str, str]] =

Note

Will be removed soon. internal use only.

@property
anonlabels: Dict[str, Tuple[str, str]] =

Undocumented

@property
labels: Dict[str, Tuple[str, str, str]] =

Undocumented

@property
objects: Dict[Tuple[str, str], Tuple[str, str]] =

Undocumented

@property
progoptions: Dict[Tuple[str, str], Tuple[str, str]] =

Undocumented