| 1 |
package ast |
| 2 |
|
| 3 |
import ( |
| 4 |
"fmt" |
| 5 |
|
| 6 |
gast "github.com/yuin/goldmark/ast" |
| 7 |
) |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
type FootnoteLink struct { |
| 12 |
gast.BaseInline |
| 13 |
Index int |
| 14 |
RefCount int |
| 15 |
RefIndex int |
| 16 |
} |
| 17 |
|
| 18 |
|
| 19 |
func (n *FootnoteLink) Dump(source []byte, level int) { |
| 20 |
m := map[string]string{} |
| 21 |
m["Index"] = fmt.Sprintf("%v", n.Index) |
| 22 |
m["RefCount"] = fmt.Sprintf("%v", n.RefCount) |
| 23 |
m["RefIndex"] = fmt.Sprintf("%v", n.RefIndex) |
| 24 |
gast.DumpHelper(n, source, level, m, nil) |
| 25 |
} |
| 26 |
|
| 27 |
|
| 28 |
var KindFootnoteLink = gast.NewNodeKind("FootnoteLink") |
| 29 |
|
| 30 |
|
| 31 |
func (n *FootnoteLink) Kind() gast.NodeKind { |
| 32 |
return KindFootnoteLink |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
func NewFootnoteLink(index int) *FootnoteLink { |
| 37 |
return &FootnoteLink{ |
| 38 |
Index: index, |
| 39 |
RefCount: 0, |
| 40 |
RefIndex: 0, |
| 41 |
} |
| 42 |
} |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
type FootnoteBacklink struct { |
| 47 |
gast.BaseInline |
| 48 |
Index int |
| 49 |
RefCount int |
| 50 |
RefIndex int |
| 51 |
} |
| 52 |
|
| 53 |
|
| 54 |
func (n *FootnoteBacklink) Dump(source []byte, level int) { |
| 55 |
m := map[string]string{} |
| 56 |
m["Index"] = fmt.Sprintf("%v", n.Index) |
| 57 |
m["RefCount"] = fmt.Sprintf("%v", n.RefCount) |
| 58 |
m["RefIndex"] = fmt.Sprintf("%v", n.RefIndex) |
| 59 |
gast.DumpHelper(n, source, level, m, nil) |
| 60 |
} |
| 61 |
|
| 62 |
|
| 63 |
var KindFootnoteBacklink = gast.NewNodeKind("FootnoteBacklink") |
| 64 |
|
| 65 |
|
| 66 |
func (n *FootnoteBacklink) Kind() gast.NodeKind { |
| 67 |
return KindFootnoteBacklink |
| 68 |
} |
| 69 |
|
| 70 |
|
| 71 |
func NewFootnoteBacklink(index int) *FootnoteBacklink { |
| 72 |
return &FootnoteBacklink{ |
| 73 |
Index: index, |
| 74 |
RefCount: 0, |
| 75 |
RefIndex: 0, |
| 76 |
} |
| 77 |
} |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
type Footnote struct { |
| 82 |
gast.BaseBlock |
| 83 |
Ref []byte |
| 84 |
Index int |
| 85 |
} |
| 86 |
|
| 87 |
|
| 88 |
func (n *Footnote) Dump(source []byte, level int) { |
| 89 |
m := map[string]string{} |
| 90 |
m["Index"] = fmt.Sprintf("%v", n.Index) |
| 91 |
m["Ref"] = string(n.Ref) |
| 92 |
gast.DumpHelper(n, source, level, m, nil) |
| 93 |
} |
| 94 |
|
| 95 |
|
| 96 |
var KindFootnote = gast.NewNodeKind("Footnote") |
| 97 |
|
| 98 |
|
| 99 |
func (n *Footnote) Kind() gast.NodeKind { |
| 100 |
return KindFootnote |
| 101 |
} |
| 102 |
|
| 103 |
|
| 104 |
func NewFootnote(ref []byte) *Footnote { |
| 105 |
return &Footnote{ |
| 106 |
Ref: ref, |
| 107 |
Index: -1, |
| 108 |
} |
| 109 |
} |
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
type FootnoteList struct { |
| 114 |
gast.BaseBlock |
| 115 |
Count int |
| 116 |
} |
| 117 |
|
| 118 |
|
| 119 |
func (n *FootnoteList) Dump(source []byte, level int) { |
| 120 |
m := map[string]string{} |
| 121 |
m["Count"] = fmt.Sprintf("%v", n.Count) |
| 122 |
gast.DumpHelper(n, source, level, m, nil) |
| 123 |
} |
| 124 |
|
| 125 |
|
| 126 |
var KindFootnoteList = gast.NewNodeKind("FootnoteList") |
| 127 |
|
| 128 |
|
| 129 |
func (n *FootnoteList) Kind() gast.NodeKind { |
| 130 |
return KindFootnoteList |
| 131 |
} |
| 132 |
|
| 133 |
|
| 134 |
func NewFootnoteList() *FootnoteList { |
| 135 |
return &FootnoteList{ |
| 136 |
Count: 0, |
| 137 |
} |
| 138 |
} |