mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-08-28 04:46:29 -04:00
9157a40ab27a697c1d12cde857800bf78248bf26
Glamour
Write beautiful command-line tools with glamour!
glamour lets you use markdown
templates to render user-friendly & stylish output on ANSI
compatible terminals.
Usage
import "github.com/charmbracelet/glamour"
in := `# Hello World
This is a simple example of glamour!
Check out the [other examples](https://github.com/charmbracelet/glamour/tree/master/examples).
Bye!
`
out, _ := glamour.Render(in, "dark")
fmt.Printf(out)
Custom Renderer
import (
"github.com/charmbracelet/glamour"
"github.com/charmbracelet/glamour/ansi"
)
in := `# Custom Renderer
Word-wrapping will occur when lines exceed the limit of 40 characters. Just so
you know: Glamour's default word-wrapping limit is set to 100 characters per
line.
Bye!
`
r, _ := glamour.NewTermRenderer("dark", ansi.Options{
WordWrap: int(40),
})
out, _ := r.Render(in)
fmt.Printf("%s", out)
}
Glamourous Projects
Check out Glow, a markdown renderer for
the command-line, which uses glamour.
License
Languages
Go
98.5%
Shell
1.5%
