mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
EPUB: redo metadata parsing
- Support the `prefix` attribute (for the `property` attr on `<meta>`) - Localized titles, names (including `sortAs`) - `belongsTo`, including `calibre:series` - `altIdentifier`, converted to URN where possible - Remove `producer`. It's now `contributor` with `role: 'bkp'`. NOTE: this is a breaking change if you assumed that `title` will always be a string, `author` will always be an array, etc.
This commit is contained in:
@@ -94,7 +94,7 @@ Processors for each book format return an object that implements the following i
|
||||
- `.href`: a string representing the destination of the item. Does not have to be a valid URL.
|
||||
- `.subitems`: a array that contains TOC items
|
||||
- `.pageList`: same as the TOC, but for the [page list](https://www.w3.org/publishing/epub32/epub-packages.html#sec-nav-pagelist).
|
||||
- `.metadata`: an object representing the metadata of the book. Currently, it follows more or less the metadata schema of [Readium's webpub manifest](https://github.com/readium/webpub-manifest).
|
||||
- `.metadata`: an object representing the metadata of the book. Currently, it follows more or less the metadata schema of [Readium's webpub manifest](https://github.com/readium/webpub-manifest). Note that titles and names can be a string or an object like `{ ja: "草枕", en: 'Kusamakura' }`, and authors, etc. can be a string, an object, or an array of strings or objects.
|
||||
- `.rendition`: an object that contains properties that correspond to the [rendition properties](https://www.w3.org/publishing/epub32/epub-packages.html#sec-package-metadata-rendering) in EPUB. If `.layout` is `"pre-paginated"`, the book is rendered with the fixed layout renderer.
|
||||
- `.resolveHref(href)`: given an href string, returns an object representing the destination referenced by the href, which has the following properties:
|
||||
- `.index`: the index of the referenced section in the `.section` array
|
||||
|
||||
Reference in New Issue
Block a user