-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
hype.go
45 lines (41 loc) · 1.29 KB
/
hype.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
37
38
39
40
41
42
43
44
45
package hype
import "github.com/gopherguides/hype/atomx"
// DefaultElements returns a map of all the default
// element parser functions.
// For example, `include`, `body`, `code`, etc.
func DefaultElements() map[Atom]ParseElementFn {
m := map[Atom]ParseElementFn{
"godoc": NewGoDocLinkNodes,
"godoc#a": NewGoDocLinkNodes,
"now": NewNowNodes,
"toc": NewToCNodes,
atomx.A: NewLinkNodes,
atomx.Body: NewBodyNodes,
atomx.Cmd: NewCmdNodes,
atomx.Code: NewCodeNodes,
atomx.Figcaption: NewFigcaptionNodes,
atomx.Figure: NewFigureNodes,
atomx.Go: NewGolangNodes,
atomx.Image: NewImageNodes,
atomx.Img: NewImageNodes,
atomx.Include: NewIncludeNodes,
atomx.Li: NewLINodes,
atomx.Link: NewLinkNodes,
atomx.Metadata: NewMetadataNodes,
atomx.Ol: NewOLNodes,
atomx.P: NewParagraphNodes,
atomx.Page: NewPageNodes,
atomx.Ref: NewRefNodes,
atomx.Table: NewTableNodes,
atomx.Td: NewTDNodes,
atomx.Th: NewTHNodes,
atomx.Thead: NewTHeadNodes,
atomx.Tr: NewTRNodes,
atomx.Ul: NewULNodes,
atomx.Var: NewVarNodes,
}
for _, h := range atomx.Headings() {
m[h] = NewHeadingNodes
}
return m
}