An open API service indexing awesome lists of open source software.

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

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: .
```