class documentation

class Formatter:

Known subclasses: pygments.formatters.bbcode.BBCodeFormatter, pygments.formatters.groff.GroffFormatter, pygments.formatters.html.HtmlFormatter, pygments.formatters.img.ImageFormatter, pygments.formatters.irc.IRCFormatter, pygments.formatters.latex.LatexFormatter, pygments.formatters.other.NullFormatter, pygments.formatters.other.RawTokenFormatter, pygments.formatters.other.TestcaseFormatter, pygments.formatters.pangomarkup.PangoMarkupFormatter, pygments.formatters.rtf.RtfFormatter, pygments.formatters.svg.SvgFormatter, pygments.formatters.terminal.TerminalFormatter, pygments.formatters.terminal256.Terminal256Formatter

View In Hierarchy

Converts a token stream to text.

Options accepted:

style
The style to use, can be a string or a Style subclass (default: "default"). Not used by e.g. the TerminalFormatter.
full
Tells the formatter to output a "full" document, i.e. a complete self-contained document. This doesn't have any effect for some formatters (default: false).
title
If full is true, the title that should be used to caption the document (default: '').
encoding
If given, must be an encoding name. This will be used to convert the Unicode token strings to byte strings in the output. If it is "" or None, Unicode strings will be written to the output file, which most file-like objects do not support (default: None).
outencoding
Overrides encoding if given.
Method format Format tokensource, an iterable of (tokentype, tokenstring) tuples and write it into outfile.
Method get​_style​_defs Return the style definitions for the current style as a string.
Class Variable aliases Undocumented
Class Variable filenames Undocumented
Class Variable name Undocumented
Method __init__ Undocumented
Class Variable unicodeoutput Undocumented
Instance Variable encoding Undocumented
Instance Variable full Undocumented
Instance Variable options Undocumented
Instance Variable style Undocumented
Instance Variable title Undocumented
def get_style_defs(self, arg=''):

Return the style definitions for the current style as a string.

arg is an additional argument whose meaning depends on the formatter used. Note that arg can also be a list or tuple for some formatters like the html formatter.

full =

Undocumented

options =

Undocumented

style =

Undocumented

title =

Undocumented