summaryrefslogtreecommitdiff
path: root/highlighting.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2010-04-07 01:37:13 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2010-04-07 01:37:13 +0200
commitb0a8979e00abddc538359a1f0c3f57e0c90ff16e (patch)
tree21b2f6be1c909e0c325ada4feaa54eca221de361 /highlighting.py
parent34fa350d1f34d5aec91c5ad5eb5d21188556052f (diff)
downloadweb-b0a8979e00abddc538359a1f0c3f57e0c90ff16e.tar.gz
web-b0a8979e00abddc538359a1f0c3f57e0c90ff16e.tar.bz2
web-b0a8979e00abddc538359a1f0c3f57e0c90ff16e.zip
Add 'emerge' and 'layman' to bash keywords
Diffstat (limited to 'highlighting.py')
-rw-r--r--highlighting.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/highlighting.py b/highlighting.py
index 9308b84..7b4fce4 100644
--- a/highlighting.py
+++ b/highlighting.py
@@ -1,9 +1,12 @@
from pygments import highlight as pygHighlight
-from pygments.lexers import get_lexer_by_name
+from pygments.token import Name
+from pygments.lexers import get_lexer_by_name, BashLexer
from pygments.formatters import HtmlFormatter
formatter = HtmlFormatter(encoding = "utf-8", classprefix="pygm", nowrap=True)
+BashLexer.tokens["basic"].append((r'\b(emerge|layman)\s*\b(?!\.)', Name.Builtin))
+
def highlight(context, code, lang):
l = get_lexer_by_name(lang, encoding = "utf-8")
context.write(pygHighlight(code, l, formatter))