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-')
35
42
lexer = guess_lexer_for_filename(path, text[:1024], encoding=encoding)
36
43
except (ClassNotFound, ValueError):