pygmentize

highlights the input file

TLDR

Highlight file syntax and print to standard output (language is inferred from the file extension)

>_ pygmentize [file.py]
copy

Explicitly set the language for syntax highlighting

>_ pygmentize -l [javascript] [input_file]
copy

List available lexers (processors for input languages)

>_ pygmentize -L lexers
copy

Save output to a file in HTML format

>_ pygmentize -f html -o [output_file.html] [input_file.py]
copy

List available output formats

>_ pygmentize -L formatters
copy

Output an HTML file, with additional formatter options (full page, with line numbers)

>_ pygmentize -f html -O "full,linenos=True" -o [output_file.html] [input_file]
copy

SYNOPSIS

pygmentize [-l | -g] [-F [:]] [-f ] [-O ] [-P ] [-o ] [] pygmentize -S