diff options
author | Martin Matusiak <numerodix@gmail.com> | 2014-03-09 15:45:06 +0100 |
---|---|---|
committer | Martin Matusiak <numerodix@gmail.com> | 2014-03-09 15:45:06 +0100 |
commit | 178587b2cefec0a804c1b2ce027ee318e8779de7 (patch) | |
tree | 545ef2227322dea97cf5956968bdab044c32f223 /ansicolor | |
parent | fa0a077d648e3c99d7cbfe3f27da4860190e6d37 (diff) | |
download | ansicolor-178587b2cefec0a804c1b2ce027ee318e8779de7.tar.gz |
add doc on highlights
Diffstat (limited to 'ansicolor')
-rw-r--r-- | ansicolor/ansicolor.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ansicolor/ansicolor.py b/ansicolor/ansicolor.py index c79902a..9afbcc7 100644 --- a/ansicolor/ansicolor.py +++ b/ansicolor/ansicolor.py @@ -143,7 +143,7 @@ def get_code(color, bold=False, reverse=False): def colorize(s, color, bold=False, reverse=False): """ - Colorize string with the color given. + Colorize a string with the color given. :param string s: The string to colorize. :param color: The color to use. @@ -179,6 +179,7 @@ def wrap_string(s, pos, color, bold=False, reverse=False): get_code(None), s[pos:]) + def highlight_string(s, *spanlists, **kw): """ Highlight spans in a string using a list of (begin, end) pairs. Each @@ -187,7 +188,7 @@ def highlight_string(s, *spanlists, **kw): :param string s: The string to highlight :param list spanlists: A list of tuples on the form ``[(begin, end)*]*`` - :param kw: can set bold, reverse, color or nocolor + :param kw: May include: `bold`, `reverse`, `color` and `nocolor` :rtype: string """ |