StylesheetLinker

Injects <link rel="stylesheet" .../> tags into every XHTML resource for each href in Book.stylesheets. Idempotent — re-running it (or running it on a book that already has links) is a no-op.

Path resolution: stylesheet hrefs are made relative to each page's own href, so a stylesheet at styles/book.css becomes styles/book.css from chapter-1.xhtml and ../styles/book.css from text/chapter-1.xhtml.

Wired into EpubWriter's default pipeline. Users who don't want this can pass their own BookProcessor to the EpubWriter constructor.

When Book.stylesheets is empty this processor returns immediately and lazy-loaded resources stay lazy. Otherwise every XHTML page is read and rewritten, materializing any lazy XHTML for the rest of the write.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun processBook(book: Book): Book