[go: up one dir, main page]

Skip to content

charmbracelet/glamour

Repository files navigation

Glamour

GoDoc Build Status Coverage Status Go ReportCard

Write gorgeous 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.Print(out)

HelloWorld Example

Custom Renderer

import "github.com/charmbracelet/glamour"

r, _ := glamour.NewTermRenderer(
	glamour.WithStandardStyle("dark"),
	glamour.WithWordWrap(40),
)

out, _ := r.Render(in)
fmt.Print(out)

Glamourous Projects

Check out Glow, a markdown renderer for the command-line, which uses glamour.

License

MIT