24
24
DEFAULT_PYGMENT_STYLE = 'colorful'
27
def highlight(path, text, encoding, style=DEFAULT_PYGMENT_STYLE):
29
29
Returns a list of highlighted (i.e. HTML formatted) strings.
32
32
formatter = HtmlFormatter(style=style, nowrap=True, classprefix='pyg-')
42
35
lexer = guess_lexer_for_filename(path, text[:1024], encoding=encoding)
43
36
except (ClassNotFound, ValueError):