Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorInvalidOptionType error = errors.New("Invalid option type")
View Source
var ErrorInvalidPathname error = errors.New("Invalid pathname")
View Source
var ErrorReservedId error = errors.New("Reserved Id")
View Source
var ErrorTOCItemTitleNotFound error = errors.New("TOC item title not found")
Functions ¶
This section is empty.
Types ¶
type ArabicNumbering ¶
type ArabicNumbering struct {
// contains filtered or unexported fields
}
func NewArabicNumbering ¶
func NewArabicNumbering(prefix string, useHierarchy bool) ArabicNumbering
func (ArabicNumbering) Prefix ¶
func (ss ArabicNumbering) Prefix() string
type Book ¶
type Book interface { // AddPage must create/truncate the file specified by path, // register as having the provided mimetype and making to figure in the book index. // If src is nil, it has to return a valid io.Writer. // If src is not nil, it must copy its content to the file and return a nil io.Writer. // If path collides with a reserved path, it must return an error. // If the page is to be added to the TOC, it must return a TOCRef object pointing // to the TOC entry that refers to the added page, otherwise, TOCRef must be nil AddPage(path string, mimetype string, src io.Reader, id string, options interface{}) (string, io.Writer, TOCRef, error) // AddFile must create/truncate the file specified by path, // register as having the provided mimetype. // If src is nil, it has to return a valid io.WriteCloser. // If src is not nil, it must copy its contents to the file and return a nil io.Writer. // If path collides with a reserved path, it must return an error. AddFile(path string, mimetype string, src io.Reader, id string, options interface{}) (string, io.Writer, error) // AddTOC must create/truncate the TOC file. // The file generated must be in html format. // If IndexGenerator != nil, the generated html nodes // must be passed through it before saved in the file. // If id!="" it must set the TOC id AddTOC(gen IndexGenerator, id string) (string, error) // AddCover must create/truncate the file specified by path, // register as having the provided mimetype and making it be the book cover. // If src is nil, it has to return a valid io.Writer. // If src is not nil, it must copy its contents to the file and return a nil io.Writer. // If path collides with a reserved path, it must return an error. AddCover(path string, mimetype string, src io.Reader, options interface{}) (string, io.Writer, error) // SpineAttr must set any spine attribute named as key with val // Error checking is allowed but it must fail silently. // This method may be deprecated if someday it is considered // too much epub addicted SpineAttr(key, val string) // Closes the Ebook Close() error }
type IndexGenerator ¶
type IndexGenerator interface { // AddItem must append the item to the end of the table of contents. // The item is provided as a link (the HTML 'A' element) with the // href attribute pointing to the page file, the text content of the // element has the title of the page and, if provided when AddPage // called, the attribute id. AddItem(item *html.Node) error // GetDocument must return the entire TOC document GetDocument() (io.Reader, error) // GetMimeType returns the mimetype of the TOC file. GetMimeType() string // GetPathName returns the relative pathname of the TOC file GetPathName() string // GetPropertyValue returns the property value for the TOC // E.G. EPub 3.0 returns 'nav' and EPub 2.o returns ” GetPropertyValue() string // GetId returns the Id value for the TOC file in the manifest // E.G. EPub 3.0 returns 'nav' and EPub 2.o returns 'ncx' GetId() string }
type LowerLetterNumbering ¶
type LowerLetterNumbering struct {
// contains filtered or unexported fields
}
func NewLowerLetterNumbering ¶
func NewLowerLetterNumbering(prefix string, useHierarchy bool) LowerLetterNumbering
func (LowerLetterNumbering) Number ¶
func (ss LowerLetterNumbering) Number(root string, number int) string
func (LowerLetterNumbering) Prefix ¶
func (ss LowerLetterNumbering) Prefix() string
type LowerRomanNumbering ¶
type LowerRomanNumbering struct {
// contains filtered or unexported fields
}
func NewLowerRomanNumbering ¶
func NewLowerRomanNumbering(prefix string, useHierarchy bool) LowerRomanNumbering
func (LowerRomanNumbering) Number ¶
func (ss LowerRomanNumbering) Number(root string, number int) string
func (LowerRomanNumbering) Prefix ¶
func (ss LowerRomanNumbering) Prefix() string
type SectionStyle ¶
type TOCItem ¶
type TOCItem interface { ItemRef() string ItemTitle() string ContentRef() string SubSectionStyle(SectionStyle) }
type UpperLetterNumbering ¶
type UpperLetterNumbering struct {
// contains filtered or unexported fields
}
func NewUpperLetterNumbering ¶
func NewUpperLetterNumbering(prefix string, useHierarchy bool) UpperLetterNumbering
func (UpperLetterNumbering) Number ¶
func (ss UpperLetterNumbering) Number(root string, number int) string
func (UpperLetterNumbering) Prefix ¶
func (ss UpperLetterNumbering) Prefix() string
type UpperRomanNumbering ¶
type UpperRomanNumbering struct {
// contains filtered or unexported fields
}
func NewUpperRomanNumbering ¶
func NewUpperRomanNumbering(prefix string, useHierarchy bool) UpperRomanNumbering
func (UpperRomanNumbering) Number ¶
func (ss UpperRomanNumbering) Number(root string, number int) string
func (UpperRomanNumbering) Prefix ¶
func (ss UpperRomanNumbering) Prefix() string
Click to show internal directories.
Click to hide internal directories.