Documentation ¶
Overview ¶
Package kepub provides functions for converting EPUBs to KEPUBs.
Index ¶
- Variables
- func FindOPF(dir string) (string, error)
- func PackEPUB(dir, epub string) error
- func UnpackEPUB(epub, dir string) error
- type Converter
- func (c *Converter) Convert(dir string) error
- func (c *Converter) ConvertEPUB(epub, kepub string) error
- func (c *Converter) TransformContentDoc(w io.Writer, r io.Reader) error
- func (c *Converter) TransformContentDocFile(rws interface{ ... }) error
- func (c *Converter) TransformOPF(w io.Writer, r io.Reader) error
- func (c *Converter) TransformOPFFile(rws interface{ ... }) error
- type ConverterOption
Constants ¶
This section is empty.
Variables ¶
var Verbose = false // TODO: implement
Verbose controls whether this package writes verbose output (it is silent otherwise).
Functions ¶
func UnpackEPUB ¶
UnpackEPUB unpacks an EPUB to a directory, which must be a nonexistent directory under an existing parent.
Types ¶
type Converter ¶
type Converter struct {
// contains filtered or unexported fields
}
Converter converts EPUB2/EPUB3 books to KEPUB.
func NewConverter ¶
func NewConverter() *Converter
NewConverter creates a new Converter. By default, no options are applied.
func NewConverterWithOptions ¶
func NewConverterWithOptions(opts ...ConverterOption) *Converter
NewConverterWithOptions is like NewConverter, with options.
func (*Converter) ConvertEPUB ¶
ConvertEPUB converts an EPUB file.
func (*Converter) TransformContentDoc ¶
TransformContentDoc transforms an HTML4/HTML5/XHTML1.1 content document for a KEPUB.
func (*Converter) TransformContentDocFile ¶
func (c *Converter) TransformContentDocFile(rws interface { io.ReadWriteSeeker Truncate(size int64) error }) error
TransformContentDocFile is like TransformContentDoc, but works inplace.
func (*Converter) TransformOPF ¶
TransformOPF transforms the OPF document for a KEPUB.
func (*Converter) TransformOPFFile ¶
func (c *Converter) TransformOPFFile(rws interface { io.ReadWriteSeeker Truncate(size int64) error }) error
TransformOPFFile is like TransformOPF, but works inplace.
type ConverterOption ¶
type ConverterOption func(*Converter)
ConverterOption configures a Converter.
func ConverterOptionAddCSS ¶
func ConverterOptionAddCSS(css string) ConverterOption
ConverterOptionAddCSS adds CSS code to a book.
func ConverterOptionFindReplace ¶
func ConverterOptionFindReplace(find, replace string) ConverterOption
ConverterOptionFindReplace replaces a raw string in the transformed HTML ( note that this reduces efficiency by requiring the HTML to be encoded into a temporary buffer before being written).
func ConverterOptionFullScreenFixes ¶
func ConverterOptionFullScreenFixes() ConverterOption
ConverterOptionFullScreenFixes applies fullscreen fixes for firmwares older than 4.19.11911.
func ConverterOptionHyphenate ¶
func ConverterOptionHyphenate(enabled bool) ConverterOption
ConverterOptionHyphenate enables or disables hyphenation. If not set, no specific state is enforced by kepubify.
func ConverterOptionSmartypants ¶
func ConverterOptionSmartypants() ConverterOption
ConverterOptionSmartypants enables smart punctuation.
Directories ¶
Path | Synopsis |
---|---|
Command kobotest tests kepub span logic (only, not divs or other kepub stuff, which is pretty straightforward anyways) against other kepubs.
|
Command kobotest tests kepub span logic (only, not divs or other kepub stuff, which is pretty straightforward anyways) against other kepubs. |