code: def doctree_read(app, doctree):
      """
      Reads documentation tree for the application and register sources in the generated documentation.
  
      :param app: application
      :param doctree: documentation tree
  
      :return None
  
      """
      env = app.builder.env
      if not hasattr(env, "_viewcode_modules"):
          env._viewcode_modules = {}
  
      if app.builder.name == "singlehtml":
          return
  
      for objnode in doctree.traverse(ExampleHeader):
          filepath = objnode.get("filename")
          relative_path = os.path.relpath(
              filepath,
              os.path.commonprefix(
                  [app.config.exampleinclude_sourceroot, filepath]
              ),
          )
          modname = relative_path.replace("/", ".")[:-3]
          show_button = register_source(app, env, modname)
          onlynode = create_node(env, relative_path, show_button)
  
          objnode.replace_self(onlynode)
  
imports: from __future__ import annotations
  import os
  import traceback
  from docutils import nodes
  from docutils.parsers.rst import directives
  from sphinx.directives.code import LiteralIncludeReader
  from sphinx.ext.viewcode import viewcode_anchor
  from sphinx.locale import _
  from sphinx.pycode import ModuleAnalyzer
  from sphinx.util import logging, parselinenos
  from sphinx.util.docutils import SphinxDirective
  from sphinx.util.nodes import set_source_info
label_desc: Use image node_id 3 for calling a global function with example usage: doctree_read(app, doctree) without return types