Skip to content

Commit

Permalink
quick: add an example (#70)
Browse files Browse the repository at this point in the history
Fixes #69.
  • Loading branch information
kevinburke authored and alecthomas committed Oct 22, 2017
1 parent 972d700 commit 8533b63
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions quick/example_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package quick_test

import (
"log"
"os"

"github.com/alecthomas/chroma/quick"
)

func Example() {
code := `package main
func main() { }
`
err := quick.Highlight(os.Stdout, code, "go", "html", "monokai")
if err != nil {
log.Fatal(err)
}
}
1 change: 1 addition & 0 deletions quick/quick.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package quick provides simple, no-configuration source code highlighting.
package quick

import (
Expand Down

0 comments on commit 8533b63

Please sign in to comment.