File: pygments2chroma.hlb

package info (click to toggle)
golang-github-alecthomas-chroma-v2 2.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 9,472 kB
  • sloc: xml: 39,589; python: 422; javascript: 357; sh: 37; makefile: 36
file content (29 lines) | stat: -rw-r--r-- 752 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
fs default() {
	gofmt fs { chromaLexer "pygments.lexers.hlb.HlbLexer"; }
}

fs script() {
	local "." with option {
		includePatterns "pygments2chroma.py"
	}
}

fs runChromaPython(string package) {
	image "python:alpine" with option { resolve; }
	run "apk add -U git"
	run "pip install -U pystache"
	run "pip install -U -e git+https://github.com/hinshun/pygments.git@hlb-lexer#egg=pygments"
	run string { format "python pygments2chroma.py %s > /out/lexer.go" package; } with option {
		dir "/chroma"
		mount script "/chroma"
		mount fs { scratch; } "/out" as chromaLexer
	}
}

fs runGoFormat(fs goFiles) {
	image "golang:alpine" with option { resolve; }
	run "gofmt -s -w /gofmt/*.go" with option {
		dir "/gofmt"
		mount goFiles "/gofmt" as gofmt
	}
}