Update README and add helloworld example

This commit is contained in:
Christian Muehlhaeuser
2019-12-25 04:31:25 +01:00
parent 3a479d0c85
commit 76ca724f16
2 changed files with 56 additions and 3 deletions
+36 -3
View File
@@ -1,5 +1,38 @@
# Glamour
Coming soon. For now, check out
[Glow](https://github.com/charmbracelet/glow), the CLI implementation of this
package.
[![GoDoc](https://godoc.org/github.com/golang/gddo?status.svg)](https://godoc.org/github.com/charmbracelet/glamour) [![Build Status](https://travis-ci.org/charmbracelet/glamour.svg?branch=master)](https://travis-ci.org/charmbracelet/glamour) [![Go ReportCard](http://goreportcard.com/badge/charmbracelet/glamour)](http://goreportcard.com/report/charmbracelet/glamour)
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)
+20
View File
@@ -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)
}