Skip to content
stump-wtfPublic

About

Go library that converts Markdown to A2UI component trees using goldmark

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

Repository files navigation

md2a2ui

Go library that converts Markdown to A2UI component trees using goldmark.

Install

go get github.com/stump-wtf/md2a2ui

Usage

package main

import (
    "encoding/json"
    "fmt"
    
    "github.com/stump-wtf/md2a2ui"
)

func main() {
    md := `# Hello World

This is **bold** and *italic*.

- Item one
- Item two

| Column A | Column B |
|----------|----------|
| Cell 1   | Cell 2   |
`

    msg, err := md2a2ui.Convert(md)
    if err != nil {
        panic(err)
    }
    
    out, _ := json.MarshalIndent(msg, "", "  ")
    fmt.Println(string(out))
}

Markdown → A2UI Mapping

Markdown A2UI Component
# H1–# H5 Text (variant: h1–h5)
###### H6 Text (variant: caption)
Paragraph Text (variant: body)
Bullet/numbered list List
Code block Card wrapping Text
Blockquote Card wrapping Text
--- (horizontal rule) Divider
Image Image
Table Column of Row children
Inline bold/italic/code/links Preserved as markdown in Text.text

License

MIT

About

Go library that converts Markdown to A2UI component trees using goldmark

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages