Documentation
¶
Overview ¶
Package epub provides EPUB metadata parsing, cover extraction, and word counting.
It parses OPF metadata directly rather than relying on third-party EPUB libraries that panic on valid EPUBs with missing optional elements. Supports EPUB 2, EPUB 3, and Calibre custom metadata.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoOPF = fmt.Errorf("no OPF path found in container.xml")
ErrNoOPF is returned when the EPUB container.xml does not reference an OPF file.
Functions ¶
func CountWordsAndPages ¶
CountWordsAndPages counts the total words across all spine content documents in the EPUB and calculates an estimated page count. Values of wordsPerPage <= 0 default to 250.
Types ¶
type Metadata ¶
type Metadata struct {
Title string
SortTitle string
Authors []Author
ISBN string
Publisher string
Subjects []string
Description string
Language string
Series string
SeriesIndex float64
Edition string
PublishDate string
}
Metadata holds the parsed metadata extracted from an EPUB file.
Click to show internal directories.
Click to hide internal directories.