mirror of
https://codeberg.org/scip/epuppy.git
synced 2025-12-17 04:20:59 +01:00
- add color and color config support - fix epub parsing - add variable margin (left and right arrow keys) - add help screen (hit `?`) - add config file support
30 lines
649 B
Go
30 lines
649 B
Go
package epub
|
|
|
|
import (
|
|
"regexp"
|
|
)
|
|
|
|
var (
|
|
cleantitle = regexp.MustCompile(`(?s)<head>.*</head>`)
|
|
cleanmarkup = regexp.MustCompile(`<[^<>]+>`)
|
|
cleanentities = regexp.MustCompile(`&.+;`)
|
|
cleancomments = regexp.MustCompile(`/*.*/`)
|
|
cleanspace = regexp.MustCompile(`^\s*`)
|
|
cleanh1 = regexp.MustCompile(`<h[1-6].*</h[1-6]>`)
|
|
)
|
|
|
|
// Ncx OPS/toc.ncx
|
|
type Ncx struct {
|
|
Points []*NavPoint `xml:"navMap>navPoint" json:"points"`
|
|
}
|
|
|
|
// NavPoint nav point
|
|
type NavPoint struct {
|
|
Text string `xml:"navLabel>text" json:"text"`
|
|
Points []NavPoint `xml:"navPoint" json:"points"`
|
|
}
|
|
|
|
type Title struct {
|
|
Content string `xml:"head>title"`
|
|
}
|