Publication(Information about EPUB book)
EPUB Publications is information about EPUB books.
EPUB Parser represents it as
book = ::.("path/to/book.epub")
book.package is a package document, a root of information tree about the book, and it has attributes to access five major models of the publication; , , , and .
Each of them has information the book in the way its own.
is literally metadata of the book, including identifiers, titles, languages, links and so on.
You can access them by:
md = book.package. # => EPUB::Publication::Package::Metadata md.titles # => [#<EPUB::Publication::Package::Metadata::Title...>, #<EPUB::Publication::Package::Metadata::Title...>, ...] # ...
Item for details.lists all the files in the package with some basic information such as filepath, media type and so on. Those files is represented as s and see
You can access manifest by:
manifest = book.package.manifest # => EPUB::Publication::Package::Manifest
And can access items it manages via some methods:
manifest.items # => an array of Items manifest.cover_image # => Item which represents cover images, which includes the string "cover-image" in its property attribute. manifest.each_item do |item| # do something with item end manifest.navs # => an array of Items which include the string "nav" in its property attribute. manifest.nav # => The first Item in manifest.navs.
For complete list of methods, see API reference:
- EPUB Publications 3.0 on IDPF site