git » git-arr » commit eb7cadd

Enable line number anchors when using pygments HtmlFormatter

author Vanya Sergeev
2014-06-30 07:59:39 UTC
committer Alberto Bertogli
2014-07-02 23:56:19 UTC
parent 48a00cb460f0e5252e28a59d462e40d891b0b54d

Enable line number anchors when using pygments HtmlFormatter

Signed-off-by: Vanya Sergeev <vsergeev@gmail.com>

utils.py +3 -1

diff --git a/utils.py b/utils.py
index 51141e4..46407bd 100644
--- a/utils.py
+++ b/utils.py
@@ -89,7 +89,9 @@ def colorize_blob(fname, s):
 
     formatter = HtmlFormatter(encoding = 'utf-8',
                     cssclass = 'source_code',
-                    linenos = 'table')
+                    linenos = 'table',
+                    anchorlinenos = True,
+                    lineanchors = 'line')
 
     return highlight(s, lexer, formatter)