class_docstr: Builds target formats from the reST sources.
class_docstr_tok: ["Builds","target","formats","from","the","reST","sources","."]
code: def __init__(self, app: Sphinx, env: BuildEnvironment) -> None:
      self.srcdir = app.srcdir
      self.confdir = app.confdir
      self.outdir = app.outdir
      self.doctreedir = app.doctreedir
      ensuredir(self.doctreedir)
  
      self.app: Sphinx = app
      self.env: BuildEnvironment = env
      self.env.set_versioning_method(
          self.versioning_method, self.versioning_compare
      )
      self.events: EventManager = app.events
      self.config: Config = app.config
      self.tags: Tags = app.tags
      self.tags.add(self.format)
      self.tags.add(self.name)
      self.tags.add("format_%s" % self.format)
      self.tags.add("builder_%s" % self.name)
  
      # images that need to be copied over (source -> dest)
      self.images: dict[str, str] = {}
      # basename of images directory
      self.imagedir = ""
      # relative path to image directory from current docname (used at writing docs)
      self.imgpath = ""
  
      # these get set later
      self.parallel_ok = False
      self.finish_tasks: Any = None
  
imports: from __future__ import annotations
  import codecs
  import pickle
  import time
  from os import path
  from typing import TYPE_CHECKING, Any
  from docutils import nodes
  from docutils.utils import DependencyList
  from sphinx.environment import CONFIG_CHANGED_REASON, CONFIG_OK, BuildEnvironment
  from sphinx.environment.adapters.asset import ImageAdapter
  from sphinx.errors import SphinxError
  from sphinx.locale import __
  from sphinx.util import UnicodeDecodeErrorHandler, get_filetype, import_object, logging, rst
  from sphinx.util.build_phase import BuildPhase
  from sphinx.util.console import bold
  from sphinx.util.display import progress_message, status_iterator
  from sphinx.util.docutils import sphinx_domains
  from sphinx.util.i18n import CatalogInfo, CatalogRepository, docname_to_domain
  from sphinx.util.osutil import SEP, ensuredir, relative_uri, relpath
  from sphinx.util.parallel import ParallelTasks, SerialTasks, make_chunks, parallel_available
  from sphinx import directives
  from sphinx import roles
label_desc: Use image node_id 1 to create a new Builder object  with example: obj = Builder(app, env)