Documentation ¶
Overview ¶
Package epubcheck provides basic bindings to run and interpret `epubcheck` tool. Features are compatible with epubcheck v4 and correspond to a subset of https://github.com/w3c/epubcheck/tree/main/docs and https://www.w3.org/publishing/epubcheck/docs/messages/
Index ¶
Constants ¶
const (
// Executable contains the path to EPUBcheck binary.
Executable = "epubcheck"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { ID string Severity string Message string Suggestion string Locations []Location }
Message represents an EPUBcheck report message.
type Report ¶
type Report struct {
Messages []*Message
}
Report represents an EPUBcheck's report.
func Run ¶
Run executes EPUBcheck on the given EPUB. Additional options are added to EPUBcheck command line. By default, Run uses "--json -" command line to capture EPUBcheck report, therefore any additional command line argument that is not consistent with it shall be avoided.
func (Report) FilterMessagesByID ¶
FilterMessagesByID filters a Report to keep only Messages whose ID match the given glob pattern.
func (Report) FilterMessagesBySeverity ¶
FilterMessagesBySeverity filters a Report to keep only Messages whose Severity match the given glob pattern.