class_docstr: Mathematics domain.
code: def resolve_xref(
      self,
      env: BuildEnvironment,
      fromdocname: str,
      builder: Builder,
      typ: str,
      target: str,
      node: pending_xref,
      contnode: Element,
  ) -> Element | None:
      assert typ in ("eq", "numref")
      result = self.equations.get(target)
      if result:
          docname, number = result
          # TODO: perhaps use rather a sphinx-core provided prefix here?
          node_id = make_id("equation-%s" % target)
          if env.config.math_numfig and env.config.numfig:
              if docname in env.toc_fignumbers:
                  numbers = env.toc_fignumbers[docname][
                      "displaymath"
                  ].get(node_id, ())
                  eqno = ".".join(map(str, numbers))
              else:
                  eqno = ""
          else:
              eqno = str(number)
  
          try:
              eqref_format = (
                  env.config.math_eqref_format or "({number})"
              )
              title = nodes.Text(eqref_format.format(number=eqno))
          except KeyError as exc:
              logger.warning(
                  __("Invalid math_eqref_format: %r"),
                  exc,
                  location=node,
              )
              title = nodes.Text("(%d)" % number)
              title = nodes.Text("(%d)" % number)
          return make_refnode(
              builder, fromdocname, docname, node_id, title
          )
      else:
          return None
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Any
  from docutils import nodes
  from docutils.nodes import Element, Node, make_id, system_message
  from sphinx.domains import Domain
  from sphinx.locale import __
  from sphinx.roles import XRefRole
  from sphinx.util import logging
  from sphinx.util.nodes import make_refnode
label_desc: Use image node_id 7 for calling the MathDomain obj's underlying member method code with example usage: obj.resolve_xref(env, fromdocname, builder, typ, target, node, contnode) and returns: make_refnode, None