diff options
author | gbrandl <devnull@localhost> | 2007-01-12 22:53:02 +0100 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2007-01-12 22:53:02 +0100 |
commit | 75dee451b1902e95b91c97f998af4c38e4ce670a (patch) | |
tree | eb7a1df61a6a1d8b0d75ae1dd957005a1b680005 /pygments/formatters/terminal.py | |
parent | efaccf6fd1322930aca142dd1a96d06d1bae84a3 (diff) | |
download | pygments-75dee451b1902e95b91c97f998af4c38e4ce670a.tar.gz |
[svn] Generate lexer, formatter and filter docs from docstrings.
There is the problem of ordering, though.
Diffstat (limited to 'pygments/formatters/terminal.py')
-rw-r--r-- | pygments/formatters/terminal.py | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/pygments/formatters/terminal.py b/pygments/formatters/terminal.py index 4d6debd9..661031e7 100644 --- a/pygments/formatters/terminal.py +++ b/pygments/formatters/terminal.py @@ -51,22 +51,26 @@ TERMINAL_COLORS = { class TerminalFormatter(Formatter): - """ - Output plain text with coloring ANSI sequences. - """ + r""" + Formats tokens with ANSI color sequences, for output in a text console. + Color sequences are terminated at newlines, so that paging the output + works correctly. - def __init__(self, **options): - """ - Accepted options: + The `get_style_defs()` method doesn't do anything special since there is + no support for common styles. + + Options accepted: - ``bg`` - Set to ``'light'`` or ``'dark'`` depending on the - terminal's background. + `bg` + Set to ``"light"`` or ``"dark"`` depending on the terminal's background + (default: ``"light"``). - ``colorscheme`` - ``None`` or a dictionary mapping token types to - ``(lightbg, darkbg)`` color names. - """ + `colorscheme` + A dictionary mapping token types to (lightbg, darkbg) color names or + ``None`` (default: ``None`` = use builtin colorscheme). + """ + + def __init__(self, **options): Formatter.__init__(self, **options) self.darkbg = options.get('bg', 'light') == 'dark' self.colorscheme = options.get('colorscheme', None) or TERMINAL_COLORS |