code: def setup_link_roles(app: Sphinx) -> None:
      for name, (base_url, caption) in app.config.extlinks.items():
          app.add_role(name, make_link_role(name, base_url, caption))
  
file_path: sphinx/sphinx/ext/extlinks.py
imports: from __future__ import annotations
  import re
  from typing import TYPE_CHECKING, Any
  from docutils import nodes, utils
  import sphinx
  from sphinx.locale import __
  from sphinx.transforms.post_transforms import SphinxPostTransform
  from sphinx.util import logging, rst
  from sphinx.util.nodes import split_explicit_title
label_desc: Use image node_id 2 for calling a global function with example usage: setup_link_roles(app) without return types