Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NCX ¶
type NCX struct {
XMLName xml.Name `xml:"ncx"`
NavPoints []NCXNavPoint `xml:"navPoint"`
} `xml:"navMap"`
}
NCX represents the EPUB 2 NCX structure.
type NCXNavPoint ¶
type NCXNavPoint struct {
Text string `xml:"text"`
} `xml:"navLabel"`
Src string `xml:"src,attr"`
} `xml:"content"`
}
NCXNavPoint represents a navigation point in NCX.
type NavElement ¶
type NavElement struct {
}
NavElement represents a nav element in the navigation document.
type NavHTML ¶
type NavHTML struct {
Nav []NavElement `xml:"nav"`
} `xml:"body"`
}
NavHTML represents the EPUB 3 navigation document structure.
type OPF ¶
type OPF struct {
Title string
Subtitle string
Authors []mediafile.ParsedAuthor
Series string
SeriesNumber *float64
Genres []string
Tags []string
Description string
Publisher string
Imprint string
URL string
ReleaseDate *time.Time
CoverFilepath string
CoverMimeType string
CoverData []byte
Identifiers []mediafile.ParsedIdentifier
Chapters []mediafile.ParsedChapter
}
type Package ¶
type Package struct {
XMLName xml.Name `xml:"package"`
Text string `xml:",chardata"`
Xmlns string `xml:"xmlns,attr"`
Version string `xml:"version,attr"`
UniqueIdentifier string `xml:"unique-identifier,attr"`
Metadata struct {
Text string `xml:",chardata"`
Opf string `xml:"opf,attr"`
Dc string `xml:"dc,attr"`
Dcterms string `xml:"dcterms,attr"`
Xsi string `xml:"xsi,attr"`
Calibre string `xml:"calibre,attr"`
Title []struct {
Text string `xml:",chardata"`
ID string `xml:"id,attr"`
} `xml:"title"`
Creator []struct {
Text string `xml:",chardata"`
ID string `xml:"id,attr"`
Role string `xml:"role,attr"`
FileAs string `xml:"file-as,attr"`
} `xml:"creator"`
Contributor struct {
Text string `xml:",chardata"`
Role string `xml:"role,attr"`
} `xml:"contributor"`
Description string `xml:"description"`
Subject []string `xml:"subject"`
Publisher string `xml:"publisher"`
Identifier []struct {
Text string `xml:",chardata"`
ID string `xml:"id,attr"`
Scheme string `xml:"scheme,attr"`
} `xml:"identifier"`
Date string `xml:"date"`
Relation []string `xml:"relation"`
Source []string `xml:"source"`
Rights string `xml:"rights"`
Language string `xml:"language"`
Meta []struct {
Text string `xml:",chardata"`
Name string `xml:"name,attr"`
Content string `xml:"content,attr"`
Refines string `xml:"refines,attr"`
Property string `xml:"property,attr"`
} `xml:"meta"`
} `xml:"metadata"`
Manifest struct {
Text string `xml:",chardata"`
Item []struct {
Text string `xml:",chardata"`
ID string `xml:"id,attr"`
Href string `xml:"href,attr"`
MediaType string `xml:"media-type,attr"`
Properties string `xml:"properties,attr"`
} `xml:"item"`
} `xml:"manifest"`
Spine struct {
Text string `xml:",chardata"`
Toc string `xml:"toc,attr"`
Itemref []struct {
Text string `xml:",chardata"`
Idref string `xml:"idref,attr"`
} `xml:"itemref"`
} `xml:"spine"`
Guide struct {
Text string `xml:",chardata"`
Reference []struct {
Text string `xml:",chardata"`
Type string `xml:"type,attr"`
Href string `xml:"href,attr"`
Title string `xml:"title,attr"`
} `xml:"reference"`
} `xml:"guide"`
}
type ParseOPFResult ¶
ParseOPFResult contains the parsed OPF data along with the raw package and base path needed for resolving relative paths to other files in the EPUB.
func ParseOPF ¶
func ParseOPF(filename string, r io.ReadCloser) (*ParseOPFResult, error)
Click to show internal directories.
Click to hide internal directories.