summaryrefslogtreecommitdiff
path: root/contrib/styles.go
blob: 2b02b9584269dfd5f78ca9a35663550a95e719ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// style.go: generate chroma css
// go run contrib/style.go > syntax.css
package main

import (
	"os"

	"github.com/alecthomas/chroma/formatters/html"
	"github.com/alecthomas/chroma/styles"
)

func main() {
	style := styles.Get("xcode") // Choose your preferred style
	if style == nil {
		style = styles.Fallback
	}

	formatter := html.New(html.WithClasses(true), html.TabWidth(2))
	formatter.WriteCSS(os.Stdout, style)
}