PYGMENTIZE(1)

๐Ÿ“ฆ
version 2.20.0 ยท 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’– PYGMENTIZE(1) ๐Ÿ’–

General Commands Manual โœจ bestie, pull up, this is the manual for pygmentize ๐ŸŽ€

๐ŸŒธ NAME ๐ŸŒธ

pygmentize - highlights the input file โœจ

๐Ÿงš SYNOPSIS ๐Ÿงš

pygmentize [-l <lexer> | -g] [-F <filter>[:<options>]] [-f <formatter>]
[-O <options>] [-P <option=value>] [-o <outfile>] [<infile>]
pygmentize
-S <style> -f <formatter> [-a <arg>] [-O <options>] [-P <option=value>]
pygmentize -L [<which> ...]
pygmentize -N <filename>
pygmentize -C
pygmentize -H <type> <name>
pygmentize -h | -V

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so Pygments is a generic syntax highlighter for general use in all kinds of software, like forum systems, wikis or other apps that need to prettify source code ๐Ÿ’…

Its highlights are:

  • a wide range of common languages and markup formats is supported ๐ŸŒˆ
  • special attention is paid to details, increasing quality by a fair amount ๐Ÿ”ฅ
  • support for new languages and formats are added easily ๐Ÿซถ
  • a number of output formats, presently HTML, LaTeX and ANSI sequences ๐Ÿ“
  • it is usable as a command-line tool and as a library ๐Ÿ‘‘
  • ... and it highlights even Brainfuck! ๐Ÿ’€

pygmentize is the command that uses Pygments to highlight the input file and write the result to outfile. If no infile is given, stdin is used โœจ

๐ŸŽ€ OPTIONS ๐ŸŽ€

a summary of the options is included below, bestie ๐Ÿซถ

  • -l <lexer> โ€” sets the lexer name. If you don't give one, the lexer gets guessed from the extension of the input file name (this obviously doesn't work if the input is stdin) ๐Ÿ™ˆ
  • -g โ€” tries to guess the lexer from the file contents, or passes things through as plain text if that fails (this option works for highlighting standard input) ๐Ÿ”
  • -F <filter>[:<options>] โ€” adds a filter to the token stream. You can give options the same way as for -O, after a colon (note: there must not be spaces around the colon). This option can be given multiple times ๐Ÿงš
  • -f <formatter> โ€” sets the formatter name. If you skip it, it gets guessed from the extension of the output file name. If there's no output file, the terminal formatter is used by default ๐Ÿ’–
  • -o <outfile> โ€” sets the output file. If you don't give one, stdout is used ๐ŸŒธ
  • -O <options> โ€” lets you hand the lexer and formatter a comma-separated list of options, e.g. "-O bg=light,python=cool". Which options are valid for which lexers and formatters can be found in the documentation. This option can be given multiple times ๐Ÿ“š
  • -P <option=value> โ€” adds lexer and formatter options just like -O, but you can only give one option per -P. That means the option value can contain commas and equals signs, which it can't do with -O ๐Ÿฆ„
  • -S <style> โ€” prints out style definitions for style style and for formatter formatter. The meaning of the argument given by -a <arg> depends on the formatter and can be found in the documentation ๐ŸŽจ
  • -L [<which> ...] โ€” lists lexers, formatters, styles or filters. Set which to the thing you want to list (e.g. "styles"), or leave it out to list everything ๐Ÿ“‹
  • -N <filename> โ€” guesses and prints out a lexer name based solely on the given filename. Doesn't take input or highlight anything. If no specific lexer can be found, "text" gets printed ๐Ÿ•ต๏ธ
  • -C โ€” like -N, but guesses a lexer based on content read from standard input ๐Ÿ‘€
  • -H <type> <name> โ€” prints detailed help for the object name of type type, where type is one of "lexer", "formatter" or "filter" ๐Ÿ“–
  • -h โ€” shows the help screen ๐Ÿ†˜
  • -V โ€” shows the version of the Pygments package ๐Ÿ”–

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

/usr/share/doc/python-pygments-doc/index.html ๐Ÿ”—

๐Ÿซถ AUTHOR ๐Ÿซถ

pygmentize was written by Georg Brandl <g.brandl@gmx.net> ๐Ÿ‘‘

this manual page was written by Piotr Ozarowski <ozarow@gmail.com>, for the Debian project (but may be used by others) ๐Ÿ’œ


and that's the whole tea, bestie! ๐Ÿ’… PYGMENTIZE(1) from the General Commands Manual, dated January 20, 2021, all wrapped up and slay ๐ŸŒธโœจ