BUPE

BUPE is an Elixir ePub generator and parser, it supports EPUB v2 and v3.

Installation

First, add bupe to your list of dependencies in mix.exs:

def deps do
  [{:bupe, "~> 0.1.0"}]
end

Then, update your dependencies:

$ mix deps.get

Usage

Builder

If you want to create an EPUB file you can do the following:

iex> config = %BUPE.Config{
...>   title: "Sample",
...>   creator: "John Doe",
...>   unique_identifier: "EXAMPLE",
...>   files: ["bacon.xhtml", "ham.xhtml", "egg.xhtml"],
...>   nav: [
...>     %{id: "ode-to-bacon", label: "1. Ode to Bacon", content: "bacon.xhtml"},
...>     %{id: "ode-to-ham", label: "2. Ode to Ham", content: "ham.xhtml"},
...>     %{id: "ode-to-egg", label: "3. Ode to Egg", content: "egg.xhtml"}
...>   ]
...> }
iex> BUPE.build(config, "food.epub")

See BUPE.Builder for more details.

Parser

If you want to parse an EPUB file you can do the following:

iex> BUPE.parse("sample.epub")
%BUPE.Config{
  title: "Sample",
  creator: "John Doe",
  unique_identifier: "EXAMPLE",
  files: ["bacon.xhtml", "ham.xhtml", "egg.xhtml"],
  nav: [
    %{id: "ode-to-bacon", label: "1. Ode to Bacon", content: "bacon.xhtml"},
    %{id: "ode-to-ham", label: "2. Ode to Ham", content: "ham.xhtml"},
    %{id: "ode-to-egg", label: "3. Ode to Egg", content: "egg.xhtml"}
  ]
}

See BUPE.Parser for more details.

License

BUPE source code is released under Apache 2 License.

Check the LICENSE for more information.