From da7e34735f3811da300ed56c504a171e3e407de9 Mon Sep 17 00:00:00 2001 From: a73x Date: Sat, 31 Aug 2024 19:08:31 +0100 Subject: chore(html): removed js for go chroma --- contrib/styles.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 contrib/styles.go (limited to 'contrib') diff --git a/contrib/styles.go b/contrib/styles.go new file mode 100644 index 0000000..2b02b95 --- /dev/null +++ b/contrib/styles.go @@ -0,0 +1,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) +} -- cgit v1.2.3