Pygments
Pygments is a syntax highlighting library for Python. It is designed to convert source code into highlighted markup in many formats for use in documentation, web pages, and terminals. The core design separates language identification from rendering: lexers parse input code into tokens, and formatters convert those tokens into a final presentation. This modular approach allows output in HTML with CSS styles, LaTeX, RTF, SVG, or ANSI-colored text for terminals, among others. Pygments ships with a large collection of lexers for programming languages, markup languages, and configuration formats, and it includes multiple style themes to control color schemes.
Pygments also provides a command-line interface through the pygmentize tool, enabling highlight of files or streams