BUPE.Item (BUPE v0.6.3)
View SourceThe Item element definition.
Each Item element represents a Publication Resource.
NOTE: The key content in the following struct is not part of the EPUB spec, but,
we use that key internally to hold the content of the file that's associated
with the Item for parsing purposes.
Summary
Types
Functions
Convert a given path into a BUPE.Item struct.
Examples
iex> BUPE.Item.from_string("book/bacon.xhtml") |> Map.take(~w(description href media_type)a)
%{
description: "bacon",
href: "book/bacon.xhtml",
media_type: "application/xhtml+xml"
}
Normalize the given BUPE.Item struct.
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
}