-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathcontent.go
36 lines (32 loc) · 1.08 KB
/
content.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 booklit
// Content is arbitrary content (e.g. text, links, paragraphs) created by
// evaluating a Booklit document or created by a plugin.
type Content interface {
// String summarizes the content. It is only used for troubleshooting.
String() string
// IsFlow must return true if the content is 'flow' content (e.g. anything
// that fits within a sentence) or false if the content is 'block' content
// (e.g. a paragraph or table).
IsFlow() bool
// Visit calls the VisitX method on Visitor corresponding to the Content's
// type.
Visit(Visitor) error
}
// Visitor is implemented in order to traverse Content.
type Visitor interface {
VisitString(String) error
VisitSequence(Sequence) error
VisitReference(*Reference) error
VisitLink(Link) error
VisitSection(*Section) error
VisitParagraph(Paragraph) error
VisitTableOfContents(TableOfContents) error
VisitPreformatted(Preformatted) error
VisitStyled(Styled) error
VisitTarget(Target) error
VisitImage(Image) error
VisitList(List) error
VisitTable(Table) error
VisitDefinitions(Definitions) error
VisitLazy(*Lazy) error
}