Documentation
¶
Overview ¶
Package azw3 renders a parsed EPUB into a KF8/AZW3 book using github.com/leotaku/mobi — no Calibre, no external tools.
The EPUB's spine documents become KF8 chapters: each document's body content is passed through nearly verbatim (KF8 is HTML+CSS underneath), with resource references rewritten to the kindle:embed / kindle:flow scheme, re-serialized as strict XHTML, and split into small balanced chunks (Kindle renders oversized or non-XML fragments as empty pages). The cdetype (EXTH 501) is written at generation time, so no post-patching is needed.
In-book hyperlinks (footnote jumps, cross-references) become real KF8 position links: hrefs are written as fixed-width placeholders, chunking records where every link target lands, and the placeholders are patched to kindle:pos:fid:off form (see links.go). JPEG/PNG/GIF images are embedded byte-for-byte — no re-encoding, transparency preserved; only device-unsafe variants (progressive/CMYK JPEG, other formats) are re-encoded as JPEG (see images.go).
Known simplifications, chosen to keep sideloaded reflowable books working well rather than to cover every EPUB feature:
- embedded fonts are dropped (@font-face is stripped; the device renders with its built-in fonts, which cover CJK)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.