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 epub file.
  
  It is a zip file with the mimetype file stored uncompressed as the first
  entry.
code: def build_epub(self) -> None:
      """Write the epub file.
  
      It is a zip file with the mimetype file stored uncompressed as the first
      entry.
      """
      outname = self.config.epub_basename + ".epub"
      logger.info(__("writing %s file..."), outname)
      epub_filename = path.join(self.outdir, outname)
      with ZipFile(epub_filename, "w", ZIP_DEFLATED) as epub:
          epub.write(
              path.join(self.outdir, "mimetype"), "mimetype", ZIP_STORED
          )
          for filename in (
              "META-INF/container.xml",
              "content.opf",
              "toc.ncx",
          ):
              epub.write(
                  path.join(self.outdir, filename),
                  filename,
                  ZIP_DEFLATED,
              )
          for filename in self.files:
              epub.write(
                  path.join(self.outdir, filename),
                  filename,
                  ZIP_DEFLATED,
              )
  
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 27 for calling the EpubBuilder obj's underlying member method code with example usage: obj.build_epub() without return types