https://github.com/codesoap/goldmarkvis
Visualize the abstract syntax trees generated by yuin/goldmark
https://github.com/codesoap/goldmarkvis
ast goldmark markdown visualization
Last synced: about 2 months ago
JSON representation
Visualize the abstract syntax trees generated by yuin/goldmark
- Host: GitHub
- URL: https://github.com/codesoap/goldmarkvis
- Owner: codesoap
- License: mit
- Created: 2024-02-25T10:09:11.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-25T10:19:11.000Z (over 2 years ago)
- Last Synced: 2025-08-25T03:21:06.006Z (10 months ago)
- Topics: ast, goldmark, markdown, visualization
- Language: Go
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
goldmarkvis is a small tool to help visualize the abstract syntax trees
generated by [yuin/goldmark](https://github.com/yuin/goldmark).
The tool takes markdown via standard input and prints a visualization to
standard output.
# Installation
To install goldmarkvis to `~/go/bin/goldmarkvis`, run:
```
go install github.com/codesoap/goldmarkvis@latest
```
# Examples
```console
$ 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: .
```