File: example_test.go

package info (click to toggle)
golang-github-alecthomas-chroma-v2 2.20.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,788 kB
  • sloc: xml: 41,690; javascript: 459; python: 420; makefile: 51; sh: 37
file content (19 lines) | stat: -rw-r--r-- 251 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package quick_test

import (
	"log"
	"os"

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

func Example() {
	code := `package main

func main() { }
`
	err := quick.Highlight(os.Stdout, code, "go", "html", "monokai")
	if err != nil {
		log.Fatal(err)
	}
}