Skip to content

Commit 8533b63

Browse files
kevinburkealecthomas
authored andcommitted
quick: add an example (#70)
Fixes #69.
1 parent 972d700 commit 8533b63

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

‎quick/example_test.go‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package quick_test
2+
3+
import (
4+
"log"
5+
"os"
6+
7+
"github.com/alecthomas/chroma/quick"
8+
)
9+
10+
func Example() {
11+
code := `package main
12+
13+
func main() { }
14+
`
15+
err := quick.Highlight(os.Stdout, code, "go", "html", "monokai")
16+
if err != nil {
17+
log.Fatal(err)
18+
}
19+
}

‎quick/quick.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package quick provides simple, no-configuration source code highlighting.
12
package quick
23

34
import (

0 commit comments

Comments
 (0)
⌂ 换网址