Pyments
Pygments is a Python library for syntax highlighting. It provides a large collection of lexers for programming languages and other text formats, along with output formatters for rendering highlighted code. Although commonly known as Pygments, it is sometimes misspelled as Pyments.
The library is implemented in Python and is designed to be embedded in other Python applications or
Pygments supports many languages and output formats, including HTML, CSS, LaTeX, RTF, and ANSI terminal colors.
Installation is straightforward via Python's package manager: pip install pygments. The project is open source and
Usage example (brief): highlight('def foo(): pass', PythonLexer(), HtmlFormatter()) returns HTML containing syntax-highlighted code. Pygments thus serves