goldmarkvis

command module
v0.0.0-...-1d118e9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 7 Imported by: 0

README

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.

Installation

To install goldmarkvis to ~/go/bin/goldmarkvis, run:

go install github.com/codesoap/goldmarkvis@latest

Examples

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL