Documentation
¶
Overview ¶
Package epubwrite renders a cssbox tree (the shared box model produced by the HTML, DOCX, Markdown, and PDF-extraction frontends) to an EPUB 3 package. It is a STRUCTURE writer built on the htmlwrite serializer (EPUB content documents ARE XHTML): the document splits into chapters at each <h1> (content before the first — or a document with no <h1> at all — is a single untitled chapter), a nav.xhtml table of contents is built from the chapter titles, and images referenced through the resource loader embed as manifest items (data: URIs stay inline — they round-trip verbatim).
Output is deterministic: fixed zip timestamps and part order, the spec-required stored (uncompressed) "mimetype" as the first entry, and a fixed dcterms:modified stamp.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// Title is the book's dc:title; the first <h1>'s text when empty, else
// "Document".
Title string
// Loader resolves image refs (an <img> src) to bytes for embedding as
// manifest items. data: URIs stay inline without a loader; for the rest,
// nil means the reference is kept as-is (logged — it will not resolve
// inside the container).
Loader resource.ResourceLoader
// Logf receives degradation diagnostics. nil -> no-op.
Logf func(string, ...any)
}
Options configures EPUB output.