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","."]
docstr: Create a dictionary with all metadata for the content.opf
  file properly escaped.
docstr_tok: ["Create","a","dictionary","with","all","metadata","for","the","content.opf","file","properly","escaped","."]
code: def content_metadata(self) -> dict[str, Any]:
      """Create a dictionary with all metadata for the content.opf
      file properly escaped.
      """
      writing_mode = self.config.epub_writing_mode
  
      if (
          source_date_epoch := os.getenv("SOURCE_DATE_EPOCH")
      ) is not None:
          time_tuple = time.gmtime(int(source_date_epoch))
      else:
          time_tuple = time.gmtime()
  
      metadata = super().content_metadata()
      metadata["description"] = html.escape(
          self.config.epub_description
      )
      metadata["contributor"] = html.escape(
          self.config.epub_contributor
      )
      metadata[
          "page_progression_direction"
      ] = PAGE_PROGRESSION_DIRECTIONS.get(writing_mode)
      metadata["ibook_scroll_axis"] = IBOOK_SCROLL_AXIS.get(
          writing_mode
      )
      metadata["date"] = html.escape(
          time.strftime("%Y-%m-%dT%H:%M:%SZ", time_tuple)
      )
      metadata["version"] = html.escape(self.config.version)
      metadata["epub_version"] = self.config.epub_version
      return metadata
  
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 2 for calling the Epub3Builder obj's underlying member method code with example usage: obj.content_metadata() and returns: metadata