pygmentize (1) - Linux Manuals
pygmentize: highlights the input file
SYNOPSISpygmentize [-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 -H <type> <name>
pygmentize -h | -V
DESCRIPTIONPygments is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code.
Its highlights are:
OPTIONSA summary of options is included below.
- -l <lexer>
- Set the lexer name. If not given, the lexer is guessed from the extension of the input file name (this obviously doesn't work if the input is stdin).
- Attempt to guess the lexer from the file contents, or pass through as plain text if this fails (this option works for highlighting standard input).
- -F <filter>[:<options>]
- Add a filter to the token stream. You can give options in 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>
- Set the formatter name. If not given, it will be guessed from the extension of the output file name. If no output file is given, the terminal formatter will be used by default.
- -o <outfile>
- Set output file. If not given, stdout is used.
- -O <options>
- With this option, you can give 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>
- This option adds lexer and formatter options like the -O option, but you can only give one option per -P. That way, the option value may contain commas and equals signs, which it can't with -O.
- -S <style>
- Print out style definitions for style <style> and for formatter <formatter>. The meaning of the argument given by -a <arg> is formatter dependent and can be found in the documentation.
- -L [<which> ...]
- List lexers, formatters, styles or filters. Set <which> to the thing you want to list (e.g. "styles"), or omit it to list everything.
- -N <filename>
- Guess and print out a lexer name based solely on the given filename. Does not take input or highlight anything. If no specific lexer can be found, "text" is printed.
- Like -N, but guess a lexer based on content read from standard input.
- -H <type> <name>
- Print detailed help for the object <name> of type <type>, where <type> is one of "lexer", "formatter" or "filter".
- Show help screen.
- Show version of the Pygments package.
AUTHORpygmentize was written by Georg Brandl <g.brandl [at] gmx.net>.
This manual page was written by Piotr Ozarowski <ozarow [at] gmail.com>, for the Debian project (but may be used by others).