code: def rcparam_role(
      name, rawtext, text, lineno, inliner, options={}, content=[]
  ):
      # Generate a pending cross-reference so that Sphinx will ensure this link
      # isn't broken at some point in the future.
      title = f'rcParams["{text}"]'
      target = "matplotlibrc-sample"
      ref_nodes, messages = inliner.interpreted(
          title, f"{title} <{target}>", "ref", lineno
      )
  
      qr = QueryReference(rawtext, highlight=text)
      qr += ref_nodes
      node_list = [qr]
  
      # The default backend would be printed as "agg", but that's not correct (as
      # the default is actually determined by fallback).
      if text in rcParamsDefault and text != "backend":
          node_list.extend(
              [
                  nodes.Text(" (default: "),
                  nodes.literal("", repr(rcParamsDefault[text])),
                  nodes.Text(")"),
              ]
          )
  
      return node_list, messages
  
file_path: matplotlib/doc/sphinxext/custom_roles.py
imports: from urllib.parse import urlsplit, urlunsplit
  from docutils import nodes
  from matplotlib import rcParamsDefault
label_desc: Use image node_id 3 for calling a global function with example usage: rcparam_role(name, rawtext, text, lineno, inliner, options, content) and returns: node_list,  messages