class_docstr: Builder that outputs epub3 files.
  
  It creates the metainfo files content.opf, nav.xhtml, toc.ncx, mimetype,
  and META-INF/container.xml. Afterwards, all necessary files are zipped to
  an epub file.
class_docstr_tok: ["Builder","that","outputs","epub3","files",".","It","creates","the","metainfo","files","content.opf",",","nav.xhtml",",","toc.ncx",",","mimetype",",","and","META-INF\/container.xml",".","Afterwards",",","all","necessary","files","are","zipped","to","an","epub","file","."]
code: def prepare_writing(self, docnames: set[str]) -> None:
      super().prepare_writing(docnames)
  
      writing_mode = self.config.epub_writing_mode
      self.globalcontext[
          "theme_writing_mode"
      ] = THEME_WRITING_MODES.get(writing_mode)
      self.globalcontext["html_tag"] = self.html_tag
      self.globalcontext["use_meta_charset"] = self.use_meta_charset
      self.globalcontext["skip_ua_compatible"] = True
  
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 sphinx import package_dir
  from sphinx.builders import _epub_base
  from sphinx.config import ENUM, Config
  from sphinx.locale import __
  from sphinx.util import logging
  from sphinx.util.fileutil import copy_asset_file
  from sphinx.util.osutil import make_filename
label_desc: Use image node_id 3 for calling the Epub3Builder obj's underlying member method code with example usage: obj.prepare_writing(docnames) without return types