Show More
@@ -224,7 +224,7 b' class CodeHtmlFormatter(HtmlFormatter):' | |||||
224 | def _wrap_code(self, source): |
|
224 | def _wrap_code(self, source): | |
225 | for cnt, it in enumerate(source): |
|
225 | for cnt, it in enumerate(source): | |
226 | i, t = it |
|
226 | i, t = it | |
227 |
t = '<div id=" |
|
227 | t = '<div id="L-%s">%s</div>' % (cnt + 1, t) | |
228 | yield i, t |
|
228 | yield i, t | |
229 | def pygmentize(filenode, **kwargs): |
|
229 | def pygmentize(filenode, **kwargs): | |
230 | """pygmentize function using pygments |
|
230 | """pygmentize function using pygments |
@@ -53,6 +53,10 b' div.annotatediv{' | |||||
53 | padding: 5px; |
|
53 | padding: 5px; | |
54 | margin: 0; |
|
54 | margin: 0; | |
55 | } |
|
55 | } | |
|
56 | .code-highlight pre div:target { | |||
|
57 | background-color: #FFFFBE !important; | |||
|
58 | } | |||
|
59 | ||||
56 | .linenos a { text-decoration: none; } |
|
60 | .linenos a { text-decoration: none; } | |
57 |
|
61 | |||
58 | .code { display: block; } |
|
62 | .code { display: block; } |
@@ -37,7 +37,7 b'' | |||||
37 | </div> |
|
37 | </div> | |
38 | <div class="code-body"> |
|
38 | <div class="code-body"> | |
39 | % if c.files_list.size < c.cut_off_limit: |
|
39 | % if c.files_list.size < c.cut_off_limit: | |
40 |
${h.pygmentize(c.files_list,linenos=True,anchorlinenos=True,lineanchors=' |
|
40 | ${h.pygmentize(c.files_list,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} | |
41 | %else: |
|
41 | %else: | |
42 | ${_('File is to big to display')} ${h.link_to(_('show as raw'), |
|
42 | ${_('File is to big to display')} ${h.link_to(_('show as raw'), | |
43 | h.url('files_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))} |
|
43 | h.url('files_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))} |
General Comments 0
You need to be logged in to leave comments.
Login now