-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathast.go
32 lines (26 loc) · 857 Bytes
/
ast.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
package pikchr
import "github.com/yuin/goldmark/ast"
// Kind is the kind of a pikchr block.
var Kind = ast.NewNodeKind("PikchrBlock")
// Block is a pikchr block.
//
// ```pikchr
// arrow right 200% "Markdown" "Source"
// box rad 10px "Markdown" "Formatter" "(markdown.c)" fit
// arrow right 200% "HTML+SVG" "Output"
// arrow <-> down 70% from last box.s
// box same "Pikchr" "Formatter" "(pikchr.c)" fi t
// ```
//
// Its raw contents are the plain text of the pikchr diagram.
type Block struct {
ast.BaseBlock
}
// IsRaw reports that this block should be rendered as-is.
func (*Block) IsRaw() bool { return true }
// Kind reports that this is a pikchrBlock.
func (*Block) Kind() ast.NodeKind { return Kind }
// Dump dumps the contents of this block to stdout.
func (b *Block) Dump(src []byte, level int) {
ast.DumpHelper(b, src, level, nil, nil)
}