class documentation
Format tokens as a raw representation for storing token streams. The format is ``tokentype<TAB>repr(tokenstring)\n``. The output can later be converted to a token stream with the `RawTokenLexer`, described in the :doc:`lexer list <lexers>`. Only two options are accepted: `compress` If set to ``'gz'`` or ``'bz2'``, compress the output with the given compression algorithm after encoding (default: ``''``). `error_color` If set to a color name, highlight error tokens using that color. If set but with no value, defaults to ``'red'``. .. versionadded:: 0.11
Method | __init__ |
Undocumented |
Method | format |
Format ``tokensource``, an iterable of ``(tokentype, tokenstring)`` tuples and write it into ``outfile``. |
Class Variable | aliases |
Undocumented |
Class Variable | filenames |
Undocumented |
Class Variable | name |
Undocumented |
Class Variable | unicodeoutput |
Undocumented |
Instance Variable | compress |
Undocumented |
Instance Variable | encoding |
Undocumented |
Instance Variable | error |
Undocumented |
Inherited from Formatter
:
Method | get |
Return the style definitions for the current style as a string. |
Instance Variable | full |
Undocumented |
Instance Variable | options |
Undocumented |
Instance Variable | style |
Undocumented |
Instance Variable | title |
Undocumented |
overrides
pygments.formatter.Formatter.format
Format ``tokensource``, an iterable of ``(tokentype, tokenstring)`` tuples and write it into ``outfile``.