Changeset - 5da1286ddd28
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 15 years ago 2011-01-27 23:01:16
marcin@python-works.com
#107 added single line highlight
3 files changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/helpers.py
Show inline comments
 
@@ -224,7 +224,7 @@ class CodeHtmlFormatter(HtmlFormatter):
 
    def _wrap_code(self, source):
 
        for cnt, it in enumerate(source):
 
            i, t = it
 
            t = '<div id="#S-%s">%s</div>' % (cnt + 1, t)
 
            t = '<div id="L-%s">%s</div>' % (cnt + 1, t)
 
            yield i, t
 
def pygmentize(filenode, **kwargs):
 
    """pygmentize function using pygments
rhodecode/public/css/pygments.css
Show inline comments
 
@@ -53,6 +53,10 @@ div.annotatediv{
 
	padding: 5px;
 
    margin: 0;
 
}
 
.code-highlight pre div:target { 
 
    background-color: #FFFFBE !important;
 
}
 
    
 
.linenos a { text-decoration: none; }
 

	
 
.code { display: block; }
rhodecode/templates/files/files_source.html
Show inline comments
 
@@ -37,7 +37,7 @@
 
	</div>
 
	<div class="code-body">
 
		% if c.files_list.size < c.cut_off_limit:
 
			${h.pygmentize(c.files_list,linenos=True,anchorlinenos=True,lineanchors='S',cssclass="code-highlight")}
 
			${h.pygmentize(c.files_list,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")}
 
		%else:
 
			${_('File is to big to display')} ${h.link_to(_('show as raw'),
 
			h.url('files_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))}
0 comments (0 inline, 0 general)