1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-02-09 13:23:51 +02:00
chroma/_tools/pygments2chroma.hlb
2020-02-26 21:03:38 +11:00

30 lines
752 B
HLB

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
}
}