pygmentize

Python-based syntax highlighter. More information: https://pygments.org/docs/cmdline/.

pygmentize file.py

pygmentize -l javascript input_file

pygmentize -L lexers

pygmentize -f html -o output_file.html input_file.py

pygmentize -L formatters

pygmentize -f html -O "full,linenos=True" -o output_file.html input_file