class_docstr: 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:
  
  * Automatic creation of a reference and a content node.
  * Optional separation of title and target with `title <target>`.
  * The implementation is a class rather than a function to make
    customization easier.
  
  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 target
    * `nodeclass` and `innernodeclass` select the node classes for
      the reference and the content node
  
  * Subclassing and overwriting `process_link()` and/or `result_nodes()`.
class_docstr_tok: ["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",":","*","Automatic","creation","of","a","reference","and","a","content","node",".","*","Optional","separation","of","title","and","target","with","`","title","<","target",">","`",".","*","The","implementation","is","a","class","rather","than","a","function","to","make","customization","easier",".","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","target","*","`","nodeclass","`","and","`","innernodeclass","`","select","the","node","classes","for","the","reference","and","the","content","node","*","Subclassing","and","overwriting","`","process_link","(",")","`","and\/or","`","result_nodes","(",")","`","."]
docstr: Called before returning the finished nodes.  *node* is the reference
  node if one was created (*is_ref* is then true), else the content node.
  This method can add other nodes and must return a ``(nodes, messages)``
  tuple (the usual return value of a role function).
docstr_tok: ["Called","before","returning","the","finished","nodes",".","*","node","*","is","the","reference","node","if","one","was","created","(","*","is_ref","*","is","then","true",")",",","else","the","content","node",".","This","method","can","add","other","nodes","and","must","return","a","``","(","nodes",",","messages",")","``","tuple","(","the","usual","return","value","of","a","role","function",")","."]
code: def result_nodes(
      self,
      document: nodes.document,
      env: BuildEnvironment,
      node: Element,
      is_ref: bool,
  ) -> tuple[list[Node], list[system_message]]:
      """Called before returning the finished nodes.  *node* is the reference
      node if one was created (*is_ref* is then true), else the content node.
      This method can add other nodes and must return a ``(nodes, messages)``
      tuple (the usual return value of a role function).
      """
      return [node], []
  
imports: from __future__ import annotations
  import re
  from typing import TYPE_CHECKING, Any
  import docutils.parsers.rst.directives
  import docutils.parsers.rst.roles
  import docutils.parsers.rst.states
  from docutils import nodes, utils
  from sphinx import addnodes
  from sphinx.locale import _, __
  from sphinx.util import ws_re
  from sphinx.util.docutils import ReferenceRole, SphinxRole
label_desc: Use image node_id 7 for calling the XRefRole obj's underlying member method code with example usage: obj.result_nodes(document, env, node, is_ref) and returns: list,  list