mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-05 16:37:19 -04:00
Update README and add helloworld example
This commit is contained in:
@@ -1,5 +1,38 @@
|
|||||||
# Glamour
|
# Glamour
|
||||||
|
|
||||||
Coming soon. For now, check out
|
[](https://godoc.org/github.com/charmbracelet/glamour) [](https://travis-ci.org/charmbracelet/glamour) [](http://goreportcard.com/report/charmbracelet/glamour)
|
||||||
[Glow](https://github.com/charmbracelet/glow), the CLI implementation of this
|
|
||||||
package.
|
Write beautiful command-line tools with *glamour*!
|
||||||
|
|
||||||
|
`glamour` lets you use [markdown](https://en.wikipedia.org/wiki/Markdown)
|
||||||
|
templates to render user-friendly & stylish output on [ANSI](https://en.wikipedia.org/wiki/ANSI_escape_code)
|
||||||
|
compatible terminals.
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```go
|
||||||
|
import "github.com/charmbracelet/glamour"
|
||||||
|
|
||||||
|
in := `# Hello World
|
||||||
|
|
||||||
|
This is a simple example of glamour!
|
||||||
|
Check out the other [other examples](https://github.com/charmbracelet/glamour/tree/master/examples).
|
||||||
|
|
||||||
|
Bye!
|
||||||
|
`
|
||||||
|
|
||||||
|
out, _ := glamour.Render(in, "dark")
|
||||||
|
fmt.Printf(out)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Glamourous Projects
|
||||||
|
|
||||||
|
Check out [Glow](https://github.com/charmbracelet/glow), a markdown renderer for
|
||||||
|
the command-line, which uses `glamour`.
|
||||||
|
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
[MIT](https://github.com/charmbracelet/glamour/raw/master/LICENSE)
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/charmbracelet/glamour"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
in := `# Hello World
|
||||||
|
|
||||||
|
This is a simple example of glamour!
|
||||||
|
Check out the other [other examples](https://github.com/charmbracelet/glamour/tree/master/examples).
|
||||||
|
|
||||||
|
Bye!
|
||||||
|
`
|
||||||
|
|
||||||
|
out, _ := glamour.Render(in, "dark")
|
||||||
|
fmt.Printf(out)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user