Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FmtDuration ¶ added in v4.15.0
FmtDuration formats a duration as "Xd Yh Zm" or "Yh Zm" if less than 24 hours
func ParseAuthorList ¶ added in v4.21.0
ParseAuthorList splits s by '&', ',', and ';', trims each part, and returns non-empty names. Used for both EPUB creator lists and PDF author strings.
func SanitizeDescription ¶ added in v4.21.0
SanitizeDescription returns sanitized HTML for use in Metadata.Description. If raw is empty or only whitespace, returns "". If raw contains no HTML (strict sanitize unchanged), wraps newline-separated paragraphs in <p>. Otherwise sanitizes with a policy that allows allowedDescriptionElements.
Types ¶
type EpubReader ¶
type EpubReader struct {
GetMetadataFromFile func(path string) (*epub.Information, error)
GetPackageFromFile func(path string) (*epub.PackageDocument, error)
}
func NewEpubReader ¶ added in v4.4.0
func NewEpubReader() EpubReader
type Metadata ¶
type Metadata struct {
Title string
Authors []string
Description template.HTML
Language string
Publication precisiondate.PrecisionDate
Words float64
Series string
SeriesIndex float64
Pages float64
Format string
Subjects []string
Illustrations int
}
func (Metadata) ReadingTime ¶
Click to show internal directories.
Click to hide internal directories.