From 20034124a19e11d96438b2ea575fc3e559195dc3 Mon Sep 17 00:00:00 2001 From: Leo sun Date: Sat, 27 Apr 2024 12:14:21 +0800 Subject: [PATCH] Introduce Config toc attribute and support application/vnd.ms-opentype font export type (#86) * Add table of contents support to config file * Add support for OpenType fonts in manifest --- lib/bupe/config.ex | 6 ++++-- lib/bupe/parser.ex | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/bupe/config.ex b/lib/bupe/config.ex index 0275469..e891ae8 100644 --- a/lib/bupe/config.ex +++ b/lib/bupe/config.ex @@ -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] @@ -114,5 +115,6 @@ defmodule BUPE.Config do cover: true, logo: nil, audio: [], - fonts: [] + fonts: [], + toc: [] end diff --git a/lib/bupe/parser.ex b/lib/bupe/parser.ex index 72f305c..e997e93 100644 --- a/lib/bupe/parser.ex +++ b/lib/bupe/parser.ex @@ -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