PYGMENTIZE(1)
๐ 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 ๐ธโจ
๐ฆ where this page comes from
- debian bookworm: python3-pygments 2.14.0+dfsg-1 ยท BSD-2-Clause
- debian trixie: python3-pygments 2.18.0+dfsg-2 ยท BSD-2-Clause
- ubuntu jammy: python3-pygments 2.11.2+dfsg-2 ยท BSD-2-Clause
- ubuntu jammy: python3-pygments 2.11.2+dfsg-2ubuntu0.1 ยท BSD-2-Clause
- ubuntu noble: python3-pygments 2.17.2+dfsg-1 ยท BSD-2-Clause
- ubuntu questing: python3-pygments 2.18.0+dfsg-2 ยท BSD-2-Clause
- ubuntu resolute: python3-pygments 2.19.2+dfsg-1 ยท BSD-2-Clause
- ubuntu stonking: python3-pygments 2.20.0+dfsg-2 ยท BSD-2-Clause
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms