code: def template_field_role(
      app,
      typ,
      rawtext,
      text,
      lineno,
      inliner,
      options=None,
      content=None,
  ):
      """
      A role that allows you to include a list of template fields in the middle of the text. This is especially
      useful when writing guides describing how to use the operator.
      The result is a list of fields where each field is shorted in the literal block.
  
      Sample usage::
  
      :template-fields:`airflow.operators.bash.BashOperator`
  
      For further information look at:
  
      * [http://docutils.sourceforge.net/docs/howto/rst-roles.html](Creating reStructuredText Interpreted
        Text Roles)
      """
      if options is None:
          options = {}
      if content is None:
          content = []
      text = utils.unescape(text)
  
      try:
          template_fields = get_template_field(app.env, text)
      except RoleException as e:
          msg = inliner.reporter.error(
              f"invalid class name {text} \n{e}",
              line=lineno,
          )
          prb = inliner.problematic(rawtext, rawtext, msg)
          return [prb], [msg]
  
      node = nodes.inline(rawtext=rawtext)
      for i, field in enumerate(template_fields):
          if i != 0:
              node += nodes.Text(", ")
          node += nodes.literal(field, "", nodes.Text(field))
  
      return [node], []
  
file_path: airflow/docs/exts/docroles.py
imports: from __future__ import annotations
  from functools import partial
  from docutils import nodes, utils
  from sphinx.ext.autodoc.importer import import_module
  from sphinx.ext.autodoc.mock import mock
label_desc: Use image node_id 2 for calling a global function with example usage: template_field_role(app, typ, rawtext, text, lineno, inliner, options, content) and returns: list,  list, list,  list