class documentation

class pending_xref_condition(nodes.Inline, nodes.TextElement):

View In Hierarchy

Node for cross-references that are used to choose appropriate content of the reference by conditions on the resolving phase.

When the pending_xref node contains one or more pending_xref_condition nodes, the cross-reference resolver should choose the content of the reference using defined conditions in condition attribute of each pending_xref_condition nodes:

<pending_xref refdomain="py" reftarget="io.StringIO ...>
    <pending_xref_condition condition="resolved">
        <literal>
            StringIO
    <pending_xref_condition condition="*">
        <literal>
            io.StringIO

After the processing of cross-reference resolver, one of the content node under pending_xref_condition node is chosen by its condition and to be removed all of pending_xref_condition nodes:

# When resolved the cross-reference successfully
<reference>
    <literal>
        StringIO

# When resolution is failed
<reference>
    <literal>
        io.StringIO

Note

This node is only allowed to be placed under pending_xref node. It is not allows to place it under other nodes. In addition, pending_xref node must contain only pending_xref_condition nodes if it contains one or more pending_xref_condition nodes.

The pending_xref_condition node should have condition attribute. Domains can be store their individual conditions into the attribute to filter contents on resolving phase. As a reserved condition name, condition="*" is used for the fallback of resolution failure. Additionally, as a recommended condition name, condition="resolved" is used for the representation of resolstion success in the intersphinx module.

New in version 4.0.