class_docstr: Documentation builder for Airflow.
docstr: Build Sphinx documentation.
  
  :param verbose: whether to show output while running
  :return: list of errors
docstr_tok: ["Build","Sphinx","documentation",".",":","param","verbose",":","whether","to","show","output","while","running",":","return",":","list","of","errors"]
code: def build_sphinx_docs(self, verbose: bool) -> list[DocBuildError]:
      """
      Build Sphinx documentation.
  
      :param verbose: whether to show output while running
      :return: list of errors
      """
      build_errors = []
      os.makedirs(self._build_dir, exist_ok=True)
  
      build_cmd = [
          "sphinx-build",
          "-T",  # show full traceback on exception
          "--color",  # do emit colored output
          "-b",  # builder to use
          "html",
          "-d",  # path for the cached environment and doctree files
          self._doctree_dir,
          "-c",
          DOCS_DIR,
          "-w",  # write warnings (and errors) to given file
          self.log_build_warning_filename,
          self._src_dir,
          self._build_dir,  # path to output directory
      ]
      env = os.environ.copy()
      env["AIRFLOW_PACKAGE_NAME"] = self.package_name
      if verbose:
          console.print(
              f"[info]{self.package_name:60}:[/] Executing cmd: ",
              " ".join(shlex.quote(c) for c in build_cmd),
          )
      else:
          console.print(
              f"[info]{self.package_name:60}:[/] Running sphinx. "
              f"The output is hidden until an error occurs."
          )
      with open(self.log_build_filename, "w") as output:
          completed_proc = run(
              build_cmd,
              cwd=self._src_dir,
              env=env,
              stdout=output if not verbose else None,
              stderr=output if not verbose else None,
              timeout=PROCESS_TIMEOUT,
          )
      if completed_proc.returncode != 0:
          build_errors.append(
              DocBuildError(
                  file_path=None,
                  line_no=None,
                  message=f"Sphinx returned non-zero exit status: {completed_proc.returncode}.",
              )
          )
      if os.path.isfile(self.log_build_warning_filename):
          with open(self.log_build_warning_filename) as warning_file:
              warning_text = warning_file.read()
          # Remove 7-bit C1 ANSI escape sequences
          warning_text = re.sub(
              r"\x1B[@-_][0-?]*[ -/]*[@-~]", "", warning_text
          )
          build_errors.extend(
              parse_sphinx_warnings(warning_text, self._src_dir)
          )
      if build_errors:
          console.print(
              f"[info]{self.package_name:60}:[/] [red]Finished docs building with errors[/]"
          )
      else:
          console.print(
              f"[info]{self.package_name:60}:[/] [green]Finished docs building successfully[/]"
          )
      return build_errors
  
imports: from __future__ import annotations
  import os
  import re
  import shlex
  import shutil
  from glob import glob
  from subprocess import run
  from rich.console import Console
  from .code_utils import ALL_PROVIDER_YAMLS, ALL_PROVIDER_YAMLS_WITH_SUSPENDED, CONSOLE_WIDTH, DOCS_DIR, PROCESS_TIMEOUT
  from .errors import DocBuildError, parse_sphinx_warnings
  from .helm_chart_utils import chart_version
  from .spelling_checks import SpellingError, parse_spelling_warnings
label_desc: Use image node_id 14 for calling the AirflowDocsBuilder obj's underlying member method code with example usage: obj.build_sphinx_docs(verbose) and returns: build_errors