From 76ca724f16d8fbdc1ea245c4ee9ab8e99bff373d Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Wed, 25 Dec 2019 04:31:25 +0100 Subject: [PATCH] Update README and add helloworld example --- README.md | 39 ++++++++++++++++++++++++++++++++++--- examples/helloworld/main.go | 20 +++++++++++++++++++ 2 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 examples/helloworld/main.go diff --git a/README.md b/README.md index a28ab96..a1bee8e 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/examples/helloworld/main.go b/examples/helloworld/main.go new file mode 100644 index 0000000..8e9ab3c --- /dev/null +++ b/examples/helloworld/main.go @@ -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) +}