class documentation

class Epub3Builder(_epub_base.EpubBuilder):

View In Hierarchy

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 Variable name Undocumented
Method build​_navigation​_doc Write the metainfo file nav.xhtml.
Method build​_navlist Create the toc navigation structure.
Method content​_metadata Create a dictionary with all metadata for the content.opf file properly escaped.
Method handle​_finish Create the metainfo files and finally the epub.
Method navigation​_doc​_metadata Create a dictionary with all metadata for the nav.xhtml file properly escaped.
Method prepare​_writing A place where you can add logic before write_doc is run
Class Variable epilog Undocumented
Class Variable supported​_remote​_images Undocumented
Class Variable template​_dir Undocumented
Class Variable use​_meta​_charset Undocumented

Inherited from EpubBuilder:

Method add​_visible​_links Add visible link targets for external links
Method build​_container Write the metainfo file META-INF/container.xml.
Method build​_content Write the metainfo file content.opf It contains bibliographic data, a file list and the spine (the reading order).
Method build​_epub Write the epub file.
Method build​_mimetype Write the metainfo file mimetype.
Method build​_navpoints Create the toc navigation structure.
Method build​_toc Write the metainfo file toc.ncx.
Method check​_refnodes Undocumented
Method copy​_download​_files Undocumented
Method copy​_image​_files Copy image files to destination directory. This overwritten method can use Pillow to convert image files.
Method copy​_image​_files​_pil Copy images using Pillow, the Python Imaging Library. The method tries to read and write the files with Pillow, converting the format and resizing the image if necessary/possible.
Method create​_build​_info Undocumented
Method fix​_fragment Return a href/id attribute with colons replaced by hyphens.
Method fix​_genindex Fix href attributes for genindex pages.
Method fix​_ids Replace colons with hyphens in href and id attributes.
Method get​_refnodes Collect section titles, their depth in the toc and the refuri.
Method get​_theme​_config Undocumented
Method get​_toc Get the total table of contents, containing the root_doc and pre and post files not managed by sphinx.
Method handle​_page Create a rendered page.
Method init Load necessary templates and perform initialization. The default implementation does nothing.
Method is​_vector​_graphics Does the filename extension indicate a vector graphic format?
Method make​_id Return a unique id for name.
Method new​_navpoint Create a new entry in the toc from the node at given level.
Method toc​_add​_files Add the root_doc, pre and post files to a list of refnodes.
Method toc​_metadata Create a dictionary with all metadata for the toc.ncx file properly escaped.
Method write​_doc Write one document file.
Class Variable add​_permalinks Undocumented
Class Variable allow​_sharp​_as​_current​_path Undocumented
Class Variable copysource Undocumented
Class Variable doctype Undocumented
Class Variable download​_support Undocumented
Class Variable embedded Undocumented
Class Variable html​_scaled​_image​_link Undocumented
Class Variable search Undocumented
Class Variable supported​_image​_types Undocumented
Instance Variable files Undocumented
Instance Variable id​_cache Undocumented
Instance Variable ignored​_files Undocumented
Instance Variable link​_suffix Undocumented
Instance Variable out​_suffix Undocumented
Instance Variable playorder Undocumented
Instance Variable refnodes Undocumented
Instance Variable tocid Undocumented
Instance Variable use​_index Undocumented

Inherited from StandaloneHTMLBuilder (via EpubBuilder):

Class Variable format Undocumented
Method __init__ Undocumented
Method ​_get​_local​_toctree Undocumented
Method ​_get​_style​_filename Undocumented
Method ​_get​_translations​_js Undocumented
Method add​_css​_file Undocumented
Method add​_js​_file Undocumented
Method add​_sidebars Undocumented
Method cleanup Cleanup any resources.
Method copy​_extra​_files copy html_extra_path files.
Method copy​_html​_favicon Undocumented
Method copy​_html​_logo Undocumented
Method copy​_html​_static​_files Undocumented
Method copy​_static​_files Undocumented
Method copy​_stemmer​_js Copy a JavaScript file for stemmer.
Method copy​_theme​_static​_files Undocumented
Method copy​_translation​_js Copy a JavaScript file for translations.
Method create​_pygments​_style​_file create a style file for pygments.
Method dump​_inventory Undocumented
Method dump​_search​_index Undocumented
Method finish Finish the building process.
Method gen​_additional​_pages Undocumented
Method gen​_indices Undocumented
Method gen​_pages​_from​_extensions Undocumented
Method get​_asset​_paths Return list of paths for assets (ex. templates, CSS, etc.).
Method get​_doc​_context Collect items for the template context of a page.
Method get​_outdated​_docs Return an iterable of output files that are outdated, or a string describing what an update build will build.
Method get​_outfilename Undocumented
Method get​_target​_uri Return the target URI for a document name.
Method index​_page Undocumented
Method init​_css​_files Undocumented
Method init​_highlighter Undocumented
Method init​_js​_files Undocumented
Method init​_templates Undocumented
Method load​_indexer Undocumented
Method post​_process​_images Pick the best candidate for an image and link down-scaled images to their high res version.
Method render​_partial Utility: Render a lone doctree node.
Method update​_page​_context Undocumented
Method write​_buildinfo Undocumented
Method write​_doc​_serialized Handle parts of write_doc that must be called in the main process if parallel build is active.
Method write​_domain​_indices Undocumented
Method write​_genindex Undocumented
Class Variable allow​_parallel Undocumented
Class Variable indexer​_dumps​_unicode Undocumented
Class Variable searchindex​_filename Undocumented
Class Variable supported​_data​_uri​_images Undocumented
Instance Variable ​_css​_files Undocumented
Instance Variable ​_script​_files Undocumented
Instance Variable build​_info Undocumented
Instance Variable css​_files Undocumented
Instance Variable current​_docname Undocumented
Instance Variable dark​_highlighter Undocumented
Instance Variable dlpath Undocumented
Instance Variable docsettings Undocumented
Instance Variable docwriter Undocumented
Instance Variable domain​_indices Undocumented
Instance Variable fignumbers Undocumented
Instance Variable globalcontext Undocumented
Instance Variable highlighter Undocumented
Instance Variable imagedir Undocumented
Instance Variable imgpath Undocumented
Instance Variable indexer Undocumented
Instance Variable last​_updated Undocumented
Instance Variable relations Undocumented
Instance Variable script​_files Undocumented
Instance Variable secnumbers Undocumented
Instance Variable theme Undocumented
Instance Variable theme​_options Undocumented
Property default​_translator​_class Undocumented
Property math​_renderer​_name Undocumented

Inherited from Builder (via EpubBuilder, StandaloneHTMLBuilder):

Method build Main build method.
Method build​_all Build all source files.
Method build​_specific Only rebuild as much as needed for changes in the filenames.
Method build​_update Only rebuild what was changed or added since last build.
Method get​_relative​_uri Return a relative URI between two source filenames.
Instance Variable events Undocumented
Method ​_read​_parallel Undocumented
Method ​_read​_serial Undocumented
Method ​_write​_parallel Undocumented
Method ​_write​_serial Undocumented
Method compile​_all​_catalogs Undocumented
Method compile​_catalogs Undocumented
Method compile​_specific​_catalogs Undocumented
Method compile​_update​_catalogs Undocumented
Method create​_template​_bridge Return the template bridge configured.
Method create​_translator Return an instance of translator.
Method get​_builder​_config Return a builder specific option.
Method get​_translator​_class Return a class of translator.
Method read (Re-)read all files new or changed since last update.
Method read​_doc Parse a file and add/update inventory entries for the doctree.
Method set​_environment Store BuildEnvironment object.
Method write Undocumented
Method write​_doctree Write the doctree to a file.
Class Variable use​_message​_catalog Undocumented
Class Variable versioning​_compare Undocumented
Class Variable versioning​_method Undocumented
Instance Variable app Undocumented
Instance Variable confdir Undocumented
Instance Variable config Undocumented
Instance Variable doctreedir Undocumented
Instance Variable env Undocumented
Instance Variable finish​_tasks Undocumented
Instance Variable images Undocumented
Instance Variable outdir Undocumented
Instance Variable parallel​_ok Undocumented
Instance Variable srcdir Undocumented
Instance Variable tags Undocumented
Instance Variable templates Undocumented
name: str =
def build_navigation_doc(self):
Write the metainfo file nav.xhtml.
def build_navlist(self, navnodes):

Create the toc navigation structure.

This method is almost same as build_navpoints method in epub.py. This is because the logical navigation structure of epub3 is not different from one of epub2.

The difference from build_navpoints method is templates which are used when generating navigation documents.

Parameters
navnodes:List[Dict[str, Any]]Undocumented
Returns
List[NavPoint]Undocumented
def content_metadata(self):
Create a dictionary with all metadata for the content.opf file properly escaped.
Returns
DictUndocumented
def handle_finish(self):
Create the metainfo files and finally the epub.
def navigation_doc_metadata(self, navlist):
Create a dictionary with all metadata for the nav.xhtml file properly escaped.
Parameters
navlist:List[NavPoint]Undocumented
Returns
DictUndocumented
def prepare_writing(self, docnames):
A place where you can add logic before write_doc is run
Parameters
docnames:Set[str]Undocumented
supported_remote_images: bool =
template_dir =
use_meta_charset: bool =

Undocumented