网页 综合 更新时间 2026-11-17 02:42:21

Doctree node classes added by Sphinx — Sphinx documentation

自动蜘蛛 www.sphinx-doc.org 正文约 3221 字
These nodes form the top-most levels of object descriptions.
Node for a list of object signatures and a common description of them.
Contains one or more desc_signature nodes and then a single desc_content node.
This node always has two classes:
The name of the domain it belongs to, e.g., py or cpp.
The name of the object type in the domain, e.g., function.
Node for a single object signature.
As default the signature is a single-line signature. Set is_multiline = True to describe a multi-line signature. In that case all child nodes must be desc_signature_line nodes.
This node always has the classes sig, sig-object, and the domain it belongs to.
Node for a line in a multi-line object signature.
It should only be used as a child of a desc_signature with is_multiline set to True. Set add_permalink = True for the line that should get the permalink.
Node for object description content.
Must be the last child node in a desc node.
Node for a signature fragment in inline text.
This is for example used for roles like cpp:expr.
This node always has the classes sig, sig-inline, and the name of the domain it belongs to.
These nodes occur in in non-multiline desc_signature nodes and in desc_signature_line nodes.
Node for the main object name.
For example, in the declaration of a Python class MyModule.MyClass, the main name is MyClass.
This node always has the class sig-name.
Node for additional name parts for an object.
For example, in the declaration of a Python class MyModule.MyClass, the additional name part is MyModule..
This node always has the class sig-prename.
Node for return types or object type names.
Node for a “returns” annotation (a la -> in Python).
Node for a general parameter list.
As default the parameter list is written in line with the rest of the signature. Set multi_line_parameter_list = True to describe a multi-line parameter list. In that case each parameter will then be written on its own, indented line. A trailing comma will be added on the last line if multi_line_trailing_comma is True.
Node for a single parameter.
Node for marking optional parts of the parameter list.
Node for signature annotations (not Python 3-style annotations).
These nodes inherit desc_sig_element and are generally translated to docutils.nodes.inline by SigElementFallbackTransform.
Extensions may create additional desc_sig_*-like nodes but in order for SigElementFallbackTransform to translate them to inline nodes automatically, they must be added to SIG_ELEMENTS via the class keyword argument _sig_element=True of desc_sig_element, e.g.:
For backwards compatibility, it is still possible to add the nodes directly using SIG_ELEMENTS.add(desc_custom_sig_node).
A set of classes inheriting desc_sig_element. Each node class is expected to be handled by the builder’s translator class if the latter does not inherit from SphinxTranslator.
This set can be extended manually by third-party extensions or by subclassing desc_sig_element and using the class keyword argument _sig_element=True.
Common parent class of nodes for inline text of a signature.
Node for a space in a signature.
Node for an identifier in a signature.
Node for an operator in a signature.
Node for punctuation in a signature.
访问原文 返回搜索 https://www.sphinx-doc.org/en/master/extdev/nodes.html
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。