Mercurial > kallithea
changeset 965:5da1286ddd28 beta
#107 added single line highlight
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 27 Jan 2011 23:01:16 +0100 |
parents | 84bb5b8b498d |
children | 63c91390853c |
files | rhodecode/lib/helpers.py rhodecode/public/css/pygments.css rhodecode/templates/files/files_source.html |
diffstat | 3 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/lib/helpers.py Thu Jan 27 21:45:30 2011 +0100 +++ b/rhodecode/lib/helpers.py Thu Jan 27 23:01:16 2011 +0100 @@ -224,7 +224,7 @@ 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
--- a/rhodecode/public/css/pygments.css Thu Jan 27 21:45:30 2011 +0100 +++ b/rhodecode/public/css/pygments.css Thu Jan 27 23:01:16 2011 +0100 @@ -53,6 +53,10 @@ padding: 5px; margin: 0; } +.code-highlight pre div:target { + background-color: #FFFFBE !important; +} + .linenos a { text-decoration: none; } .code { display: block; }
--- a/rhodecode/templates/files/files_source.html Thu Jan 27 21:45:30 2011 +0100 +++ b/rhodecode/templates/files/files_source.html Thu Jan 27 23:01:16 2011 +0100 @@ -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))}