class_docstr: Builder that outputs epub files.
  
  It creates the metainfo files container.opf, toc.ncx, mimetype, and
  META-INF/container.xml.  Afterwards, all necessary files are zipped to an
  epub file.
class_docstr_tok: ["Builder","that","outputs","epub","files",".","It","creates","the","metainfo","files","container.opf",",","toc.ncx",",","mimetype",",","and","META-INF\/container.xml",".","Afterwards",",","all","necessary","files","are","zipped","to","an","epub","file","."]
docstr: Write the metainfo file toc.ncx.
code: def build_toc(self) -> None:
      """Write the metainfo file toc.ncx."""
      logger.info(__("writing toc.ncx file..."))
  
      if self.config.epub_tocscope == "default":
          doctree = self.env.get_and_resolve_doctree(
              self.config.root_doc,
              self,
              prune_toctrees=False,
              includehidden=False,
          )
          refnodes = self.get_refnodes(doctree, [])
          self.toc_add_files(refnodes)
      else:
          # 'includehidden'
          refnodes = self.refnodes
      self.check_refnodes(refnodes)
      navpoints = self.build_navpoints(refnodes)
      level = max(item["level"] for item in self.refnodes)
      level = min(level, self.config.epub_tocdepth)
      copy_asset_file(
          path.join(self.template_dir, "toc.ncx_t"),
          self.outdir,
          self.toc_metadata(level, navpoints),
      )
  
imports: from __future__ import annotations
  import html
  import os
  import re
  import time
  from os import path
  from typing import TYPE_CHECKING, Any, NamedTuple
  from urllib.parse import quote
  from zipfile import ZIP_DEFLATED, ZIP_STORED, ZipFile
  from docutils import nodes
  from docutils.utils import smartquotes
  from sphinx import addnodes
  from sphinx.builders.html import BuildInfo, StandaloneHTMLBuilder
  from sphinx.locale import __
  from sphinx.util import logging
  from sphinx.util.display import status_iterator
  from sphinx.util.fileutil import copy_asset_file
  from sphinx.util.osutil import copyfile, ensuredir, relpath
label_desc: Use image node_id 26 for calling the EpubBuilder obj's underlying member method code with example usage: obj.build_toc() without return types