Highlight Syntax - Chroma Code Formatter | Online Free DevTools by Hexmos
Highlight syntax with Chroma, a versatile code formatter for various programming languages. Effortlessly format code snippets for web or documentation. Free online tool, no registration required.
chroma
A general-purpose syntax highlighter. The
--lexeroption is usually unnecessary, as it will be automatically determined based on the file extension. More information: https://github.com/alecthomas/chroma.
- Highlight source code from a file with the Python lexer and output to
stdout:
chroma --lexer {{python}} {{path/to/source_file.py}}
- Highlight source code from a file with the Go lexer and output to an HTML file:
chroma --lexer {{go}} --formatter {{html}} {{path/to/source_file.go}} > {{path/to/target_file.html}}
- Highlight source code from
stdinwith the C++ lexer and output to an SVG file, using the Monokai style:
{{command}} | chroma --lexer {{c++}} --formatter {{svg}} --style {{monokai}} > {{path/to/target_file.svg}}
- List available lexers, styles and formatters:
chroma --list