dependabot[bot] 1b955add54 Bump github.com/alecthomas/chroma/v2 from 2.6.0 to 2.7.0
Bumps [github.com/alecthomas/chroma/v2](https://github.com/alecthomas/chroma) from 2.6.0 to 2.7.0.
- [Release notes](https://github.com/alecthomas/chroma/releases)
- [Changelog](https://github.com/alecthomas/chroma/blob/master/.goreleaser.yml)
- [Commits](https://github.com/alecthomas/chroma/compare/v2.6.0...v2.7.0)

---
updated-dependencies:
- dependency-name: github.com/alecthomas/chroma/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-22 22:53:44 +01:00
2023-03-16 11:04:53 +01:00
2023-03-08 14:38:17 +01: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
2019-11-15 12:27:41 -06:00
2023-03-22 14:50:30 -04: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.
  • GitLab CLI, GitLab's official command line tool.
  • Gitea CLI, Gitea's official command line tool.
  • Meteor, an easy-to-use, plugin-driven metadata collection framework.

Feedback

Wed love to hear your thoughts on this project. Feel free to drop us a note!

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%