class Terminal256Formatter(Formatter):
Known subclasses: pygments.formatters.terminal256.TerminalTrueColorFormatter
Format tokens with ANSI color sequences, for output in a 256-color
terminal or console. Like in TerminalFormatter
color sequences
are terminated at newlines, so that paging the output works correctly.
The formatter takes colors from a style defined by the style
option
and converts them to nearest ANSI 256-color escape sequences. Bold and
underline attributes from the style are preserved (and displayed).
Terminal256Formatter
will map these to non extended foreground color.
See :ref:`AnsiTerminalStyle` for more information.Options accepted:
Method | __init__ |
Undocumented |
Method | _build_color_table |
Undocumented |
Method | _closest_color |
Undocumented |
Method | _color_index |
Undocumented |
Method | _setup_styles |
Undocumented |
Method | _write_lineno |
Undocumented |
Method | format |
Format tokensource, an iterable of (tokentype, tokenstring) tuples and write it into outfile. |
Method | format_unencoded |
Undocumented |
Class Variable | aliases |
Undocumented |
Class Variable | filenames |
Undocumented |
Class Variable | name |
Undocumented |
Instance Variable | _lineno |
Undocumented |
Instance Variable | best_match |
Undocumented |
Instance Variable | linenos |
Undocumented |
Instance Variable | style_string |
Undocumented |
Instance Variable | usebold |
Undocumented |
Instance Variable | useitalic |
Undocumented |
Instance Variable | useunderline |
Undocumented |
Instance Variable | xterm_colors |
Undocumented |
Inherited from Formatter
:
Method | get_style_defs |
Return the style definitions for the current style as a string. |
Class Variable | unicodeoutput |
Undocumented |
Instance Variable | encoding |
Undocumented |
Instance Variable | full |
Undocumented |
Instance Variable | options |
Undocumented |
Instance Variable | style |
Undocumented |
Instance Variable | title |
Undocumented |
pygments.formatter.Formatter.format