EpubExport.h header
#include <ew/app/EpubExport.h>
Namespace ew::app
EpubImage struct
struct ew::app::EpubImage
One image to embed in an EPUB: the project-relative path exactly as it appears in an  reference in the manuscript (which becomes the packaged OEBPS/<path> and the <img src> that resolves to it), and the image file's bytes.
Members
QString ew::app::EpubImage::path
The project-relative path as it appears in the manuscript's  reference.
QByteArray ew::app::EpubImage::data
The image file's bytes.
Functions
std::vector< QString > ew::app::manuscriptImageReferences(const std::vector< ManuscriptSection > §ions)
The distinct project-relative image paths referenced by  across sections' bodies and synopses, in first-seen order. External URLs (http:, https:), data URIs, and server-absolute paths (a leading /) are excluded because only a project-relative file can be packaged into the book. A caller reads each returned path's bytes and passes them to ew::app::manuscriptToEpub as ew::app::EpubImage entries so the exported EPUB is self-contained.
QByteArray ew::app::manuscriptToEpub(const std::vector< ManuscriptSection > §ions, const QString &title, const std::vector< EpubImage > &images={})
Compiles sections (from ew::app::compileManuscript) into a complete EPUB 3 publication, returned as the bytes of the .epub file. An EPUB is an Open Container Format ZIP archive; this builds one with ew::app::makeZip – the uncompressed mimetype entry first (as the spec requires), the META-INF/container.xml pointer, an OPF package document (metadata + manifest + reading-order spine), an EPUB navigation document, and one reflowable XHTML document per chapter (the manuscript's top-level sections, each carrying its nested sections). Each chapter body is rendered from Markdown with ew::app::markdownToHtml and adjusted to XHTML. title names the publication (used for the dc:title, the derived dc:identifier, and the navigation heading); an empty title falls back to "Untitled". Every image in images is packaged under OEBPS/<path> and declared in the manifest with a media type derived from its extension, so an  in the prose resolves to a bundled resource rather than a dangling reference (pass the bytes of the paths ew::app::manuscriptImageReferences returns; the default empty list embeds no images). The result opens in any EPUB reader (Apple Books, Adobe Digital Editions, calibre, Thorium) and validates as EPUB 3.