chroma
all
A general-purpose syntax highlighter. The `--lexer` option is usually unnecessary, as it will be automatically determined based on the file extension.
More info →Options (3)
-l, --lexerbooleanHighlight source code from a file with the Python lexer and output to `stdout`
Example:
chroma {{[-l|--lexer]}} {{python}} {{path/to/source_file.py}}-f, --formatterbooleanHighlight source code from a file with the Go lexer and output to an HTML file
Example:
chroma {{[-l|--lexer]}} {{go}} {{[-f|--formatter]}} {{html}} {{path/to/source_file.go}} > {{path/to/target_file.html}}-s, --stylebooleanHighlight source code from `stdin` with the C++ lexer and output to an SVG file, using the Monokai style
Example:
{{command}} | chroma {{[-l|--lexer]}} {{c++}} {{[-f|--formatter]}} {{svg}} {{[-s|--style]}} {{monokai}} > {{path/to/target_file.svg}}Examples (4)
Highlight source code from a file with the Python lexer and output to `stdout`
Highlight source code from a file with the Go lexer and output to an HTML file
Highlight source code from `stdin` with the C++ lexer and output to an SVG file, using the Monokai style
List available lexers, styles, and formatters
chroma --listmade by @shridhargupta | data from tldr-pages