Book
Representation of a Book.
All resources of a Book (html, css, xml, fonts, images) are represented as Resources. See getResources() for access to these.
A Book as 3 indexes into these Resources, as per the epub specification.
- Spine
- these are the Resources to be shown when a user reads the book from start to finish.
- Table of Contents
- *
- The table of contents. Table of Contents references may be in a different order and contain different Resources than the spine, and often do. *
- Guide
- The Guide has references to a set of special Resources like the cover page, the Glossary, the copyright page, etc.
The complication is that these 3 indexes may and usually do point to different pages. A chapter may be split up in 2 pieces to fit it in to memory. Then the spine will contain both pieces, but the Table of Contents only the first.
The Content page may be in the Table of Contents, the Guide, but not in the Spine. Etc.
Please see the illustration at: doc/schema.svg
Author
paul
jake
Properties
The book's cover image.
Hrefs of stylesheets that should be auto-linked from every XHTML page at write time. Populated by addStylesheet; consumed by io.documentnode.epub4kmp.epub.StylesheetLinker.
The Table of Contents of the book.
Functions
Adds a raw Resource to the book's set of Resources without touching the TableOfContents or Spine.
Adds a resource to the book's set of resources, table of contents and if there is no resource with the id in the spine also adds it to the spine.
Adds the resource to the table of contents of the book as a child section of the given parentSection
Adds stylesheet as a resource and marks it for auto-linking from every XHTML page at write time.
Rebuilds the Spine so its order matches the TableOfContents.