BUPE.Item (BUPE v0.6.5)
View SourceThe item element definition from the EPUB manifest.
Each Item represents a publication resource bundled in an EPUB (for example, XHTML content documents, images, or stylesheets).
The content field in the struct is not part of the EPUB spec; BUPE uses it
internally to hold the resource contents when parsing.
Summary
Types
Functions
This function is deprecated. Use normalize/1 instead.
Normalizes a binary path or BUPE.Item struct.
When fields are missing, this function fills in defaults:
idbecomes a generated UUID-based identifier.descriptiondefaults to the file name without extension.media_typeis inferred from thehrefpath.
Examples
iex> BUPE.Item.normalize(%BUPE.Item{
...> id: "ode-to-bacon",
...> href: "book/bacon.xhtml",
...> description: "Ode to Bacon"
...> })
%BUPE.Item{
description: "Ode to Bacon",
duration: nil,
fallback: nil,
href: "book/bacon.xhtml",
id: "ode-to-bacon",
media_overlay: nil,
media_type: "application/xhtml+xml",
properties: nil
}