highlight
converts source code to formatted output with syntax highlighting
TLDR
Highlight source code
$ highlight [file.py]
Output as HTML$ highlight -O html [file.py] > [file.html]
Output as ANSI (terminal)$ highlight -O ansi [file.py]
Specify language$ highlight --syntax=[python] [file]
Use specific theme$ highlight --style=[molokai] [file.py]
List supported languages$ highlight --list-scripts=langs
List available themes$ highlight --list-scripts=themes
SYNOPSIS
highlight [options] [files...]
DESCRIPTION
highlight converts source code to formatted output with syntax highlighting. It supports over 200 programming languages and can output to HTML, ANSI, RTF, LaTeX, and other formats.
The tool is useful for documentation, presentations, and generating printable source listings with proper syntax coloring.
PARAMETERS
-O format
Output format (html, ansi, xhtml, rtf, latex, tex, svg).-S, --syntax lang
Specify source language.-s, --style name
Color theme.-l, --line-numbers
Include line numbers.-i, --input file
Input file.-o, --output file
Output file.--list-scripts type
List langs, themes, or plugins.-f, --fragment
Omit document headers.--inline-css
Embed CSS in HTML.
CAVEATS
Language detection may need hints. Theme appearance varies by output format. Some languages have limited support.
HISTORY
highlight was created by Andre Simon as a universal source code highlighter. It has been actively developed since 2002, continuously adding language support and output formats.
SEE ALSO
pygmentize(1), bat(1), source-highlight(1), vim(1)

