code: def replace_command_docs(
      has_attr_list: bool = False, **options: Any
  ) -> Iterator[str]:
      for option in ("module", "command"):
          if option not in options:
              raise MkDocsClickException(
                  f"Option {option!r} is required"
              )
  
      module = options["module"]
      command = options["command"]
      prog_name = options.get("prog_name", None)
      depth = int(options.get("depth", 0))
      style = options.get("style", "plain")
      remove_ascii_art = options.get("remove_ascii_art", False)
      show_hidden = options.get("show_hidden", False)
      list_subcommands = options.get("list_subcommands", False)
  
      command_obj = load_command(module, command)
  
      prog_name = prog_name or command_obj.name or command
  
      return make_command_docs(
          prog_name=prog_name,
          command=command_obj,
          depth=depth,
          style=style,
          remove_ascii_art=remove_ascii_art,
          show_hidden=show_hidden,
          list_subcommands=list_subcommands,
          has_attr_list=has_attr_list,
      )
  
file_path: mkdocs-click/mkdocs_click/_extension.py
imports: from __future__ import annotations
  from typing import Any, Iterator
  from markdown.extensions import Extension
  from markdown.extensions.attr_list import AttrListExtension
  from markdown.preprocessors import Preprocessor
  from ._docs import make_command_docs
  from ._exceptions import MkDocsClickException
  from ._loader import load_command
  from ._processing import replace_blocks
label_desc: Use image node_id 1 for calling a global function with example usage: replace_command_docs(has_attr_list) and returns: make_command_docs