class_docstr: Builds target formats from the reST sources.
class_docstr_tok: ["Builds","target","formats","from","the","reST","sources","."]
docstr: Parse a file and add/update inventory entries for the doctree.
code: def read_doc(self, docname: str, *, _cache: bool = True) -> None:
      """Parse a file and add/update inventory entries for the doctree."""
      self.env.prepare_settings(docname)
  
      # Add confdir/docutils.conf to dependencies list if exists
      docutilsconf = path.join(self.confdir, "docutils.conf")
      if path.isfile(docutilsconf):
          self.env.note_dependency(docutilsconf)
  
      filename = self.env.doc2path(docname)
      filetype = get_filetype(self.app.config.source_suffix, filename)
      publisher = self.app.registry.get_publisher(self.app, filetype)
      # record_dependencies is mutable even though it is in settings,
      # explicitly re-initialise for each document
      publisher.settings.record_dependencies = DependencyList()
      with sphinx_domains(self.env), rst.default_role(
          docname, self.config.default_role
      ):
          # set up error_handler for the target document
          codecs.register_error(
              "sphinx", UnicodeDecodeErrorHandler(docname)
          )  # type: ignore[arg-type]
  
          publisher.set_source(source_path=filename)
          publisher.publish()
          doctree = publisher.document
  
      # store time of reading, for outdated files detection
      self.env.all_docs[docname] = time.time_ns() // 1_000
  
      # cleanup
      self.env.temp_data.clear()
      self.env.ref_context.clear()
  
      self.write_doctree(docname, doctree, _cache=_cache)
  
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 22 for calling the Builder obj's underlying member method code with example usage: obj.read_doc(docname) without return types