The OPF package
Wrapper around the package. The details of the various entries are in the EPUB 3 Specification.
The module relies on the xmlbuilder2
package, which generates an XML file out of a set of JS objects. See the documentation of that library for
the details; the short overview is:
- JSON names starting with
"@""
represent an attribute. - JSON name
"#""
represent textual content of the element. - Otherwise a JSON name refers to an embedded dictionary representing a subelement in XML.
The core of the module is in the [[PackageWrapper]] class.
I
I
I
Link
The "link" element content, as define in the spec. @rel
is optional, because it is also used for OPF collections, and
@rel
is indeed optional in that context.
I
Usage
import * as mod from "lib/opf.ts";