class_docstr: Class to wrap the different commands of this script.
  
  All public methods of this class can be called as parameters of the
  script.
docstr: Create in the build directory an html file with a redirect,
  for every row in REDIRECTS_FILE.
docstr_tok: ["Create","in","the","build","directory","an","html","file","with","a","redirect",",","for","every","row","in","REDIRECTS_FILE","."]
code: def _add_redirects(self) -> None:
      """
      Create in the build directory an html file with a redirect,
      for every row in REDIRECTS_FILE.
      """
      with open(REDIRECTS_FILE, encoding="utf-8") as mapping_fd:
          reader = csv.reader(mapping_fd)
          for row in reader:
              if not row or row[0].strip().startswith("#"):
                  continue
  
              html_path = os.path.join(BUILD_PATH, "html")
              path = (
                  os.path.join(html_path, *row[0].split("/")) + ".html"
              )
  
              if not self.include_api and (
                  os.path.join(html_path, "reference") in path
                  or os.path.join(html_path, "generated") in path
              ):
                  continue
  
              try:
                  title = self._get_page_title(row[1])
              except Exception:
                  # the file can be an ipynb and not an rst, or docutils
                  # may not be able to read the rst because it has some
                  # sphinx specific stuff
                  title = "this page"
  
              with open(path, "w", encoding="utf-8") as moved_page_fd:
                  html = f"""\
  <html>
      <head>
          <meta http-equiv="refresh" content="0;URL={row[1]}.html"/>
      </head>
      <body>
          <p>
              The page has been moved to <a href="{row[1]}.html">{title}</a>
          </p>
      </body>
  <html>"""
  
                  moved_page_fd.write(html)
  
imports: import argparse
  import csv
  import importlib
  import os
  import shutil
  import subprocess
  import sys
  import webbrowser
  import docutils
  import docutils.parsers.rst
label_desc: Use image node_id 7 for calling the DocBuilder obj's underlying member method code with example usage: obj._add_redirects() without return types