2020-10-11 09:44:44 +01:00
|
|
|
# chroma
|
|
|
|
|
|
|
|
> Chroma is a general-purpose syntax highlighting library and corresponding command, for Go.
|
|
|
|
> More information: <https://github.com/alecthomas/chroma>.
|
|
|
|
|
|
|
|
- Highlight a source file with python lexer and output to terminal:
|
|
|
|
|
|
|
|
`chroma --lexer="{{python}}" {{source_file}}`
|
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- Highlight a source file with the Go lexer and output to an HTML file:
|
2020-10-11 09:44:44 +01:00
|
|
|
|
|
|
|
`chroma --lexer="{{go}}" --formatter="{{html}}" {{source_file}} > {{html_file}}`
|
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- Highlight a source file with the C++ lexer and output to an SVG, using the Monokai style:
|
2020-10-11 09:44:44 +01:00
|
|
|
|
|
|
|
`chroma --lexer="{{c++}}" --formatter="{{svg}}" --syle="{{monokai}}" {{source_file}} > {{svg_file}}`
|