diff options
Diffstat (limited to 'highlighting.py')
-rw-r--r-- | highlighting.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/highlighting.py b/highlighting.py index f859920..439ae78 100644 --- a/highlighting.py +++ b/highlighting.py @@ -7,13 +7,11 @@ formatter = HtmlFormatter(encoding = "utf-8", classprefix="pygm", nowrap=True) BashLexer.tokens["basic"].append((r'\b(emerge|layman|git(?!:))\s*\b(?!\.)', Name.Builtin)) -def highlight(context, code, lang): +def highlight(code, lang): l = get_lexer_by_name(lang, encoding = "utf-8") - context.write(pygHighlight(code, l, formatter)) - return '' + return pygHighlight(code, l, formatter) -def get_css(context): - context.write("""<style type="text/css"> +def get_css(): + return """<style type="text/css"> %s -</style>""" % formatter.get_style_defs()) - return '' +</style>""" % formatter.get_style_defs() |