Go syntax highlighting framework
go get github.com/speedata/decorate
See the application gohigh
for an example: https://github.com/speedata/gohigh
decorate.HighlightFile(inputfile, inputfilter, outputfilter)
where inputfile
is the filename (+ path) to the input file, inputfilter
the name of the input filter (currently only text
and xml
are supported) and outputfilter
is currently either html
or text
.
See the file inputfilter/text/text.go
for a sample input filter (a language lexer) and outputfilter/text/text.go
for a dummy output filter. Just follow the code there and add an import statement in decorate.go
to activate the filter.
Status: pre alpha
Supported/maintained: yes
Contribution welcome: yes (pull requests, issues)
Main page: https://github.com/speedata/decorate
License: MIT
Contact: [email protected]