Documentation
¶
Index ¶
- func FindChapterIndexByTitle(r Reader, title string) int
- func RestoreFromAnchor(r Reader, anchor ProgressAnchor)
- type EpubReader
- func (epub *EpubReader) BookTitle() string
- func (r *EpubReader) Current() string
- func (epub *EpubReader) CurrentChapterIndex() int
- func (epub *EpubReader) CurrentChapterTitle() string
- func (r *EpubReader) CurrentPos() int
- func (r *EpubReader) CurrentView(lines int) string
- func (r *EpubReader) First() string
- func (epub *EpubReader) GetProgress() string
- func (epub *EpubReader) GetTOC() string
- func (epub *EpubReader) GetTOCWithSelection(selected, pageSize int) string
- func (r *EpubReader) Goto(pos int) string
- func (epub *EpubReader) GotoChapter(index int) string
- func (r *EpubReader) Last() string
- func (epub *EpubReader) Load(filePath string) error
- func (r *EpubReader) Next() string
- func (epub *EpubReader) NextChapter() string
- func (r *EpubReader) Prev() string
- func (epub *EpubReader) PrevChapter() string
- func (epub *EpubReader) Reflow(width int)
- func (r *EpubReader) Search(query string, start int, forward bool) (int, bool)
- func (r *EpubReader) Total() int
- type ProgressAnchor
- type Reader
- type Snapshot
- type TxtReader
- func (txt *TxtReader) BookTitle() string
- func (r *TxtReader) Current() string
- func (txt *TxtReader) CurrentChapterIndex() int
- func (txt *TxtReader) CurrentChapterTitle() string
- func (r *TxtReader) CurrentPos() int
- func (r *TxtReader) CurrentView(lines int) string
- func (r *TxtReader) First() string
- func (r *TxtReader) GetProgress() string
- func (txt *TxtReader) GetTOC() string
- func (txt *TxtReader) GetTOCWithSelection(selected, pageSize int) string
- func (r *TxtReader) Goto(pos int) string
- func (txt *TxtReader) GotoChapter(index int) string
- func (r *TxtReader) Last() string
- func (txt *TxtReader) Load(path string) error
- func (r *TxtReader) Next() string
- func (txt *TxtReader) NextChapter() string
- func (r *TxtReader) Prev() string
- func (txt *TxtReader) PrevChapter() string
- func (txt *TxtReader) Reflow(width int)
- func (r *TxtReader) Search(query string, start int, forward bool) (int, bool)
- func (r *TxtReader) Total() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindChapterIndexByTitle ¶
func RestoreFromAnchor ¶
func RestoreFromAnchor(r Reader, anchor ProgressAnchor)
Types ¶
type EpubReader ¶
type EpubReader struct {
// contains filtered or unexported fields
}
func NewEpubReader ¶
func NewEpubReader() *EpubReader
func (*EpubReader) BookTitle ¶
func (epub *EpubReader) BookTitle() string
func (*EpubReader) CurrentChapterIndex ¶
func (epub *EpubReader) CurrentChapterIndex() int
func (*EpubReader) CurrentChapterTitle ¶
func (epub *EpubReader) CurrentChapterTitle() string
func (*EpubReader) CurrentPos ¶
func (r *EpubReader) CurrentPos() int
func (*EpubReader) CurrentView ¶
func (*EpubReader) GetProgress ¶
func (epub *EpubReader) GetProgress() string
func (*EpubReader) GetTOC ¶
func (epub *EpubReader) GetTOC() string
func (*EpubReader) GetTOCWithSelection ¶
func (epub *EpubReader) GetTOCWithSelection(selected, pageSize int) string
func (*EpubReader) GotoChapter ¶
func (epub *EpubReader) GotoChapter(index int) string
func (*EpubReader) Load ¶
func (epub *EpubReader) Load(filePath string) error
func (*EpubReader) NextChapter ¶
func (epub *EpubReader) NextChapter() string
func (*EpubReader) PrevChapter ¶
func (epub *EpubReader) PrevChapter() string
func (*EpubReader) Reflow ¶
func (epub *EpubReader) Reflow(width int)
type ProgressAnchor ¶
func AnchorFromReader ¶
func AnchorFromReader(r Reader) ProgressAnchor
type Reader ¶
type Reader interface {
Load(path string) error
Reflow(width int)
BookTitle() string
Current() string
CurrentView(lines int) string
Total() int
Search(query string, start int, forward bool) (int, bool)
Next() string
Prev() string
First() string
Last() string
CurrentPos() int
Goto(pos int) string
GetProgress() string
CurrentChapterTitle() string
CurrentChapterIndex() int
NextChapter() string
PrevChapter() string
GetTOC() string
GetTOCWithSelection(selected, pageSize int) string
GotoChapter(index int) string
}
type Snapshot ¶
type Snapshot struct {
Kind string `json:"kind"`
Title string `json:"title,omitempty"`
RawText string `json:"raw_text,omitempty"`
ChapterText []string `json:"chapter_text,omitempty"`
ChapterTitles []string `json:"chapter_titles,omitempty"`
}
func SnapshotFromReader ¶
type TxtReader ¶
type TxtReader struct {
// contains filtered or unexported fields
}
func NewTxtReader ¶
func NewTxtReader() *TxtReader
func (*TxtReader) CurrentChapterIndex ¶
func (*TxtReader) CurrentChapterTitle ¶
func (*TxtReader) CurrentPos ¶
func (r *TxtReader) CurrentPos() int
func (*TxtReader) CurrentView ¶
func (*TxtReader) GetProgress ¶
func (r *TxtReader) GetProgress() string
func (*TxtReader) GetTOCWithSelection ¶
func (*TxtReader) GotoChapter ¶
func (*TxtReader) NextChapter ¶
func (*TxtReader) PrevChapter ¶
Click to show internal directories.
Click to hide internal directories.