PYGMENTIZE(1)

๐Ÿ“ฆ version 2.19.1, in opensuse-leap 16.0

๐Ÿ’… PYGMENTIZE โ€” the manual page but make it cute

okay so bestie, welcome to pygmentize, the general commands manual page, and no cap this is the glow-up tool for your source code ๐ŸŽ€


โœจ NAME โœจ

pygmentize โ€” highlights the input file. that's it. that's the whole job. she highlights. she slays. periodt ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

like, here's all the ways you can call her:

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 ๐Ÿฆ‹

so Pygments is a generic syntax highlighter โ€” for general use in, like, all kinds of software. forum systems? wikis? other applications that need to prettify source code? she's there. she's always there. main character energy fr fr ๐Ÿ‘‘

its highlights are (and honestly, the way that this list ate):

  • a wide range of common languages and markup formats is supported ๐ŸŒˆ
  • special attention is paid to details, increasing quality by a fair amount โ€” she's a details girlie, lowkey obsessed โœจ
  • 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! ๐Ÿ˜ญ iconic, no notes

pygmentize is a command that uses Pygments to highlight the input file and write the result to <outfile>. If no <infile> is given, stdin is used. literally that simple bestie ๐Ÿ’–


๐ŸŒŸ OPTIONS ๐ŸŒŸ

a summary of options is included below. buckle up, there's a whole menu ๐Ÿ“

  • -l <lexer> โ€” set the lexer name. if you don't give one, the lexer is guessed from the extension of the input file name. (this obviously doesn't work if the input is stdin โ€” like, she can't read a filename that isn't there, bestie ๐Ÿ’€)
  • -g โ€” 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, so yes, you can pipe into her ๐Ÿ™ˆ
  • -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. window shopping, basically ๐Ÿ›๏ธ
  • -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. she's just guessing, don't @ her ๐Ÿคทโ€โ™€๏ธ
  • -C โ€” 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 ๐Ÿ“š
  • -h โ€” show help screen ๐Ÿ’ฌ
  • -V โ€” show version of the Pygments package ๐Ÿท๏ธ

๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

  • /usr/share/doc/python-pygments/index.html

go read it, iykyk ๐Ÿ“–


๐ŸŒˆ AUTHOR ๐ŸŒˆ

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

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


okay that's the whole page bestie, go highlight something and make it iconic โœจ

January 20, 2021 โ€” General Commands Manual, PYGMENTIZE(1) ๐Ÿ’– bye bye, mwah!

๐Ÿ“ฆ where this page comes from