Documentation ¶
Overview ¶
Copyright 2022 Hal Canary Use of this program is governed by the file LICENSE.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var UnsupportedUrlError = errors.New("unsupported url")
Returned by a EbookGeneratorFunction when the URL can not be handled.
Functions ¶
func ConvertToEbook ¶
Convert a html file to an epub, using `ebook-convert`.
func PopulateInfo ¶ added in v0.1.1
Populate `info` based on common patterns.
func RegisterEbookGenerator ¶ added in v1.0.0
func RegisterEbookGenerator(downloadFunction EbookGeneratorFunction)
Register the given function.
Types ¶
type EbookGeneratorFunction ¶ added in v1.0.0
A function that generates an ebook from a url. @param url - the URL of the title page of the book. @param doPopulate - if true, download and populate the entire EbookInfo data structure, not just its metadata.
type EbookInfo ¶
type EbookInfo struct { Authors string Comments string Title string Source string Language string Chapters []Chapter Modified time.Time Cover []byte }
Ebook content and metadata.
func DownloadEbook ¶ added in v1.0.0
Return the result of the first registered download function that does not return UnsupportedUrlError. @param url - the URL of the title page of the book. @param doPopulate - if true, download and populate the entire EbookInfo data structure, not just its metadata.
func (EbookInfo) CalculateLastModified ¶
Return the time of most recently modified chapter.