Main entry points

This module contains the main external entry points for the EPUB conversion. These are:

  • Main processing steps for the creation of EPUB files: the [[RespecToEPUB]] class;
  • A representation of the EPUB OCF instances (i.e., of the ZIP file for the final content): the [[OCF]] class;
  • A representation of the EPUB “package”, i.e., the XML file providing the main manifest of the EPUB file: the [[PackageWrapper]] class.

Classes

c
RespecToEPUB(
trace?: boolean,
print_package?: boolean
)

Main Processing class

Interfaces

I
Global

Interface of the "Global" data, to be used by various utilities

  • config: any

    The initial config object, originally filled by the user (respec puts a copy of this object, as JSON, into the header of the generated content).

  • document_url: string

    The URL of the document to be processed

  • dom: jsdom.JSDOM

    The DOM element, as returned from parsing

  • html_element: Element

    The DOM HTML element of the main document

  • opf_content: opf.PackageWrapper

    The class used for the generation of the EPUB opf file

  • package: boolean

    [Debug] Whether the opf instance should be should be printed to the console instead of generating an EPUB file

  • process_version: number

    Process version used to generate this file. The possible values are 2016 and 2021

  • resources: ResourceRef[]

    List of extra resources, to be added to the opf file and into the final EPUB file. The main role of the [[create_epub_from_dom]] function is to collect all relevant resources; once done, this array is used to generate the final package.opf file as well as to collect the resources themselves and add them to the final epub file.

  • trace: boolean

    [Debug] Whether trace information should be printed to the console

I
ResourceRef

Interface for the resources that, eventually, should be added to the EPUB file