Skip to content

Commit

Permalink
Introduce Config toc attribute and support application/vnd.ms-opentyp…
Browse files Browse the repository at this point in the history
…e font export type (#86)

* Add table of contents support to config file

* Add support for OpenType fonts in manifest
  • Loading branch information
Tomyail committed Apr 27, 2024
1 parent 5bf9742 commit 2003412
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/bupe/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ defmodule BUPE.Config do
cover: boolean,
logo: String.t(),
audio: [map()],
fonts: [map()]
fonts: [map()],
toc: [map()]
}

@enforce_keys [:title, :pages]
Expand Down Expand Up @@ -114,5 +115,6 @@ defmodule BUPE.Config do
cover: true,
logo: nil,
audio: [],
fonts: []
fonts: [],
toc: []
end
3 changes: 2 additions & 1 deletion lib/bupe/parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ defmodule BUPE.Parser do
pages: find_manifest(xml, "application/xhtml+xml"),
audio: find_manifest(xml, ["audio/mpeg", "audio/mp4"]),
fonts:
find_manifest(xml, ["application/font-sfnt", "application/font-woff", "font/woff2"])
find_manifest(xml, ["application/font-sfnt", "application/font-woff", "font/woff2", "application/vnd.ms-opentype"]),
toc: find_manifest(xml, "application/x-dtbncx+xml")
}}
end

Expand Down

0 comments on commit 2003412

Please sign in to comment.