| 1 |
.TH PYGMENTIZE 1 "January 20, 2021" |
| 2 |
|
| 3 |
.SH NAME |
| 4 |
pygmentize \- highlights the input file |
| 5 |
|
| 6 |
.SH SYNOPSIS |
| 7 |
.B \fBpygmentize\fP |
| 8 |
.RI [-l\ \fI<lexer>\fP\ |\ -g]\ [-F\ \fI<filter>\fP[:\fI<options>\fP]]\ [-f\ \fI<formatter>\fP] |
| 9 |
.RI [-O\ \fI<options>\fP]\ [-P\ \fI<option=value>\fP]\ [-o\ \fI<outfile>\fP]\ [\fI<infile>\fP] |
| 10 |
.br |
| 11 |
.B \fBpygmentize\fP |
| 12 |
.RI -S\ \fI<style>\fP\ -f\ \fI<formatter>\fP\ [-a\ \fI<arg>\fP]\ [-O\ \fI<options>\fP]\ [-P\ \fI<option=value>\fP] |
| 13 |
.br |
| 14 |
.B \fBpygmentize\fP |
| 15 |
.RI -L\ [\fI<which>\fP\ ...] |
| 16 |
.br |
| 17 |
.B \fBpygmentize\fP |
| 18 |
.RI -N\ \fI<filename>\fP |
| 19 |
.br |
| 20 |
.B \fBpygmentize\fP |
| 21 |
.RI -C |
| 22 |
.br |
| 23 |
.B \fBpygmentize\fP |
| 24 |
.RI -H\ \fI<type>\fP\ \fI<name>\fP |
| 25 |
.br |
| 26 |
.B \fBpygmentize\fP |
| 27 |
.RI -h\ |\ -V |
| 28 |
|
| 29 |
.SH DESCRIPTION |
| 30 |
Pygments is a generic syntax highlighter for general use in all kinds |
| 31 |
of software such as forum systems, wikis or other applications that need to |
| 32 |
prettify source code. |
| 33 |
.PP |
| 34 |
Its highlights are: |
| 35 |
* a wide range of common languages and markup formats is supported |
| 36 |
* special attention is paid to details, increasing quality by a fair amount |
| 37 |
* support for new languages and formats are added easily |
| 38 |
* a number of output formats, presently HTML, LaTeX and ANSI sequences |
| 39 |
* it is usable as a command-line tool and as a library |
| 40 |
* ... and it highlights even Brainfuck! |
| 41 |
.PP |
| 42 |
\fBpygmentize\fP is a command that uses Pygments to highlight the input file and |
| 43 |
write the result to \fI<outfile>\fP. If no \fI<infile>\fP is given, stdin is used. |
| 44 |
.SH OPTIONS |
| 45 |
A summary of options is included below. |
| 46 |
.TP |
| 47 |
.B \-l \fI<lexer>\fP |
| 48 |
Set the lexer name. If not given, the lexer is guessed from the extension of the |
| 49 |
input file name (this obviously doesn't work if the input is stdin). |
| 50 |
.TP |
| 51 |
.B \-g |
| 52 |
Attempt to guess the lexer from the file contents, or pass through as plain text |
| 53 |
if this fails (this option works for highlighting standard input). |
| 54 |
.TP |
| 55 |
.B \-F \fI<filter>\fP[:\fI<options>\fP] |
| 56 |
Add a filter to the token stream. You can give options in the same way as for |
| 57 |
-O after a colon (note: there must not be spaces around the colon). |
| 58 |
This option can be given multiple times. |
| 59 |
.TP |
| 60 |
.B \-f \fI<formatter>\fP |
| 61 |
Set the formatter name. If not given, it will be guessed from the extension of |
| 62 |
the output file name. If no output file is given, the terminal formatter will be |
| 63 |
used by default. |
| 64 |
.TP |
| 65 |
.B \-o \fI<outfile>\fP |
| 66 |
Set output file. If not given, stdout is used. |
| 67 |
.TP |
| 68 |
.B \-O \fI<options>\fP |
| 69 |
With this option, you can give the lexer and formatter a comma-separated list of |
| 70 |
options, e.g. "-O bg=light,python=cool". Which options are valid for which |
| 71 |
lexers and formatters can be found in the documentation. |
| 72 |
This option can be given multiple times. |
| 73 |
.TP |
| 74 |
.B \-P \fI<option=value>\fP |
| 75 |
This option adds lexer and formatter options like the -O option, but |
| 76 |
you can only give one option per -P. That way, the option value may contain |
| 77 |
commas and equals signs, which it can't with -O. |
| 78 |
.TP |
| 79 |
.B \-S \fI<style>\fP |
| 80 |
Print out style definitions for style \fI<style>\fP and for formatter \fI<formatter>\fP. |
| 81 |
The meaning of the argument given by |
| 82 |
.B \-a \fI<arg>\fP |
| 83 |
is formatter dependent and can be found in the documentation. |
| 84 |
.TP |
| 85 |
.B \-L [\fI<which>\fP ...] |
| 86 |
List lexers, formatters, styles or filters. Set \fI<which>\fP to the thing you want |
| 87 |
to list (e.g. "styles"), or omit it to list everything. |
| 88 |
.TP |
| 89 |
.B \-N \fI<filename>\fP |
| 90 |
Guess and print out a lexer name based solely on the given filename. Does not |
| 91 |
take input or highlight anything. If no specific lexer can be found, "text" |
| 92 |
is printed. |
| 93 |
.TP |
| 94 |
.B \-C |
| 95 |
Like \fI-N\fP, but guess a lexer based on content read from standard input. |
| 96 |
.TP |
| 97 |
.B \-H \fI<type>\fP \fI<name>\fP |
| 98 |
Print detailed help for the object \fI<name>\fP of type \fI<type>\fP, where \fI<type>\fP is one |
| 99 |
of "lexer", "formatter" or "filter". |
| 100 |
.TP |
| 101 |
.B \-h |
| 102 |
Show help screen. |
| 103 |
.TP |
| 104 |
.B \-V |
| 105 |
Show version of the Pygments package. |
| 106 |
.SH SEE ALSO |
| 107 |
/usr/share/doc/python-pygments/index.html |
| 108 |
.SH AUTHOR |
| 109 |
pygmentize was written by Georg Brandl <[email protected]>. |
| 110 |
.PP |
| 111 |
This manual page was written by Piotr Ozarowski <[email protected]>, |
| 112 |
for the Debian project (but may be used by others). |