2022-10-15 07:01:28 +02:00
2022-10-15 05:21:37 +02:00
2022-07-27 20:49:42 +02:00
2019-12-19 00:43:46 +01:00
2020-08-24 15:46:02 +02:00
2022-01-23 21:02:18 +01:00
2019-12-20 22:55:00 +01:00
2019-12-20 22:55:00 +01:00
2022-06-15 17:43:37 -04:00
2022-10-15 05:21:37 +02:00
2022-10-15 05:21:37 +02:00
2019-11-15 12:27:41 -06:00
2022-07-27 20:49:42 +02:00

Glamour

Glamour Title Treatment
Latest Release GoDoc Build Status Coverage Status Go ReportCard

Stylesheet-based markdown rendering for your CLI apps.

Glamour dark style example

glamour lets you render markdown documents & templates on ANSI compatible terminals. You can create your own stylesheet or simply use one of the stylish defaults.

Usage

import "github.com/charmbracelet/glamour"

in := `# Hello World

This is a simple example of Markdown rendering with Glamour!
Check out the [other examples](https://github.com/charmbracelet/glamour/tree/master/examples) too.

Bye!
`

out, err := glamour.Render(in, "dark")
fmt.Print(out)
Hello World example

Custom Renderer

import "github.com/charmbracelet/glamour"

r, _ := glamour.NewTermRenderer(
    // detect background color and pick either the default dark or light theme
    glamour.WithAutoStyle(),
    // wrap output at specific width (default is 80)
    glamour.WithWordWrap(40),
)

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

Styles

You can find all available default styles in our gallery. Want to create your own style? Learn how!

There are a few options for using a custom style:

  1. Call glamour.Render(inputText, "desiredStyle")
  2. Set the GLAMOUR_STYLE environment variable to your desired default style or a file location for a style and call glamour.RenderWithEnvironmentConfig(inputText)
  3. Set the GLAMOUR_STYLE environment variable and pass glamour.WithEnvironmentConfig() to your custom renderer

Glamourous Projects

Check out these projects, which use glamour:

  • Glow, a markdown renderer for the command-line.
  • GitHub CLI, GitHubs official command line tool.
  • GLab, an open source GitLab command line tool.
  • Meteor, an easy-to-use, plugin-driven metadata collection framework.

License

MIT


Part of Charm.

The Charm logo

Charm热爱开源 • Charm loves open source

S
Description
A temporary, hacked together fork of Glamour v0.7.0 to reduce the startup time and binary size of MUTN while other solutions are evaluated.
Readme MIT
2.6 MiB
Languages
Go 98.5%
Shell 1.5%