1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-06-06 15:06:00 +02:00
tldr/pages/common/pygmentize.md
Rudinski Zvonimir 7d360fface add pygmentize
2017-04-28 08:28:19 +01:00

482 B

pygmentize

CLI Python Syntax Highlighter.

  • Highlight syntax:

pygmentize {{filename}}

  • Highlight syntax (another language):

pygmentize -l {{lexer}} {{filename}}

  • Show avaliable lexers:

pygmentize -L lexers

  • Output to HTML:

pygmentize -f html -l {{lexer}} -o {{output}} {{filename}}

  • Show avaliable output formats:

pygmentize -L formatters

  • Output to HTML with a line numbers:

pygmentize -f html -O linenos=1 -l {{lexer}} -o {{output}} {{filename}}