forked from kapmahc/epub
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ncx.go
36 lines (31 loc) · 1.02 KB
/
ncx.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package epub
//Ncx OPS/toc.ncx
type Ncx struct {
Points []NavPoint `xml:"navMap>navPoint" json:"points"`
PageList PageList `xml:"pageList" json:"page_list"`
}
//NavPoint nav point
type NavPoint struct {
Text string `xml:"navLabel>text" json:"text"`
Content Content `xml:"content" json:"content"`
Points []NavPoint `xml:"navPoint" json:"points"`
PlayerOrder int `xml:"playOrder" json:"play_order"`
}
//Content nav-point content
type Content struct {
Src string `xml:"src,attr" json:"src"`
}
// PageList page list
type PageList struct {
PageTarget []PageTarget `xml:"pageTarget" json:"page_targets"`
Class string `xml:"class" json:"class"`
ID string `xml:"id" json:"id"`
}
// PageTarget page target
type PageTarget struct {
Text string `xml:"navLabel>text" json:"text"`
Value string `xml:"value" json:"value"`
Type string `xml:"type" json:"type"`
PlayOrder int `xml:"playOrder" json:"play_order"`
Content Content `xml:"content" json:"content"`
}