class XRefRole(ReferenceRole):
Known subclasses: sphinx.domains.c.CXRefRole
, sphinx.domains.cpp.CPPXRefRole
, sphinx.domains.javascript.JSXRefRole
, sphinx.domains.math.MathReferenceRole
, sphinx.domains.python.PyXRefRole
, sphinx.domains.std.EnvVarXRefRole
, sphinx.domains.std.OptionXRefRole
, sphinx.domains.std.TokenXRefRole
, sphinx.roles.AnyXRefRole
A generic cross-referencing role. To create a callable that can be used as a role function, create an instance of this class.
The general features of this role are:
title
.Customization can be done in two ways:
Supplying constructor parameters:
* fix_parens
to normalize parentheses (strip from target, and add to
title if configured)
lowercase
to lowercase the targetnodeclass
and innernodeclass
select the node classes for
the reference and the content nodeSubclassing and overwriting process_link()
and/or result_nodes()
.
Method | __init__ |
Undocumented |
Method | create_non_xref_node |
Undocumented |
Method | create_xref_node |
Undocumented |
Method | process_link |
No summary |
Method | result_nodes |
No summary |
Method | run |
Undocumented |
Method | update_title_and_target |
Undocumented |
Instance Variable | classes |
Undocumented |
Instance Variable | fix_parens |
Undocumented |
Instance Variable | has_explicit_title |
Undocumented |
Instance Variable | innernodeclass |
Undocumented |
Instance Variable | lowercase |
Undocumented |
Instance Variable | nodeclass |
Undocumented |
Instance Variable | refdomain |
Undocumented |
Instance Variable | reftype |
Undocumented |
Instance Variable | warn_dangling |
Undocumented |
Inherited from ReferenceRole
:
Instance Variable | disabled |
Undocumented |
Instance Variable | target |
Undocumented |
Instance Variable | title |
Undocumented |
Method | __call__ |
Undocumented |
Class Variable | explicit_title_re |
Undocumented |
Inherited from SphinxRole
(via ReferenceRole
):
Method | get_location |
Get current location info for logging. |
Instance Variable | content |
Undocumented |
Instance Variable | inliner |
Undocumented |
Instance Variable | lineno |
Undocumented |
Instance Variable | name |
Undocumented |
Instance Variable | options |
Undocumented |
Instance Variable | rawtext |
Undocumented |
Instance Variable | text |
Undocumented |
Property | config |
Reference to the .Config object. |
Property | env |
Reference to the .BuildEnvironment object. |
Method | get_source_info |
Undocumented |
Method | set_source_info |
Undocumented |
Undocumented
Parameters | |
fix_parens:bool | Undocumented |
lowercase:bool | Undocumented |
nodeclass:Type[ | Undocumented |
innernodeclass:Type[ | Undocumented |
warn_dangling:bool | Undocumented |
Undocumented
Returns | |
Tuple[ | Undocumented |
sphinx.domains.c.CXRefRole
, sphinx.domains.cpp.CPPXRefRole
, sphinx.domains.javascript.JSXRefRole
, sphinx.domains.python.PyXRefRole
, sphinx.domains.std.OptionXRefRole
, sphinx.domains.std.TokenXRefRole
, sphinx.roles.AnyXRefRole
Parameters | |
env:BuildEnvironment | Undocumented |
refnode:Element | Undocumented |
has_explicit_title:bool | Undocumented |
title:str | Undocumented |
target:str | Undocumented |
Returns | |
Tuple[ | Undocumented |
Parameters | |
document:nodes.document | Undocumented |
env:BuildEnvironment | Undocumented |
node:Element | Undocumented |
is_ref:bool | Undocumented |
Returns | |
Tuple[ | Undocumented |
sphinx.util.docutils.SphinxRole.run
sphinx.domains.c.CXRefRole
Undocumented
Returns | |
Tuple[ | Undocumented |
Undocumented
Parameters | |
title:str | Undocumented |
target:str | Undocumented |
Returns | |
Tuple[ | Undocumented |