goldmarkvis is a small tool to help visualize the abstract syntax trees generated by yuin/goldmark.
The tool takes markdown via standard input and prints a visualization to standard output.
To install goldmarkvis to ~/go/bin/goldmarkvis
, run:
go install github.com/codesoap/goldmarkvis@latest
$ echo "foo" | goldmarkvis
Type: Doc, Kind: Document, Text: foo
Type: Block, Kind: Paragraph, Text: foo
Type: Inline, Kind: Text, Text: foo
$ echo "" | goldmarkvis
Type: Doc, Kind: Document, (no text)
$ cat test.md
# This is a heading
Some text.
> A quote with some `inline code`.
$ cat /tmp/test.md | goldmarkvis
Type: Doc, Kind: Document, Text: This is a headingSome text.A quote with some inline code.
Type: Block, Kind: Heading, Text: This is a heading
Type: Inline, Kind: Text, Text: This is a heading
Type: Block, Kind: Paragraph, Text: Some text.
Type: Inline, Kind: Text, Text: Some text.
Type: Block, Kind: Blockquote, Text: A quote with some inline code.
Type: Block, Kind: Paragraph, Text: A quote with some inline code.
Type: Inline, Kind: Text, Text: A quote with some
Type: Inline, Kind: CodeSpan, Text: inline code
Type: Inline, Kind: Text, Text: inline code
Type: Inline, Kind: Text, Text: .