Chroma takes source code and other structured text and converts it into syntax highlighted HTML, ANSI-coloured text, and more.
Chroma is based heavily on Pygments, and includes translators for Pygments lexers and styles. Chroma, like Pygments, has the concepts of lexers, formatters and styles.
Lexers convert source text into a stream of tokens, styles specify how token types are mapped to colours, and formatters convert tokens and styles into formatted output.
A package exists for each of these, containing a global Registry variable with all of the registered implementations. There are also helper functions for using the registry in each package, such as looking up lexers by name or matching filenames, etc.
This is free and open source software.
Key Features
- Supports a wide range of languages.
- Generates standalone HTML with embedded CSS, but more flexibility is available.
- Command-line interface is included
Website: github.com/alecthomas/chroma
Support:
Developer: Alec Thomas
License: MIT License
Chroma is written in Go. Learn Go with our recommended free books and free tutorials.
Related Software
| Syntax Highlighters | |
|---|---|
| Prism | Lightweight, extensible syntax highlighter, with modern web standards in mind |
| Re-Highlight | Powerful syntax highlighter |
| Chroma | General purpose syntax highlighter |
| Pygments | Generic syntax highlighter |
| Rouge | Pure Ruby syntax highlighter |
| Highlight.js | JavaScript syntax highlighter with language auto-detection |
Read our verdict in the software roundup.
Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more. Know a useful open source Linux program that we haven’t covered yet? Let us know by completing this form. |

