Changeset - 5aba7adff196
[Not reviewed]
default
0 2 0
Marcin Kuzminski - 15 years ago 2010-09-25 23:36:10
marcin@python-works.com
little gui change for file source
2 files changed with 14 insertions and 6 deletions:
0 comments (0 inline, 0 general)
pylons_app/lib/helpers.py
Show inline comments
 
@@ -213,14 +213,23 @@ class _FilesBreadCrumbs(object):
 
        return literal('/'.join(url_l))
 

	
 
files_breadcrumbs = _FilesBreadCrumbs()
 
class CodeHtmlFormatter(HtmlFormatter):
 

	
 
    def wrap(self, source, outfile):
 
        return self._wrap_div(self._wrap_pre(self._wrap_code(source)))
 

	
 
    def _wrap_code(self, source):
 
        for cnt, it in enumerate(source, 1):
 
            i, t = it
 
            t = '<div id="#S-%s">%s</div>' % (cnt, t)
 
            yield i, t
 
def pygmentize(filenode, **kwargs):
 
    """
 
    pygmentize function using pygments
 
    @param filenode:
 
    """
 
    return literal(code_highlight(filenode.content,
 
                                  filenode.lexer, HtmlFormatter(**kwargs)))
 
                                  filenode.lexer, CodeHtmlFormatter(**kwargs)))
 

	
 
def pygmentize_annotation(filenode, **kwargs):
 
    """
pylons_app/public/css/pygments.css
Show inline comments
 
@@ -22,10 +22,13 @@ div.codeblock .code-header .commit{
 
	margin-left:25px;
 
	font-weight: normal;
 
}
 

	
 
div.codeblock .code-body table{
 
    width: 0 !important;    
 
}
 

	
 
div.code-body {
 
	background-color: #FFFFFF;
 
}
 
div.code-body pre .match{
 
	background-color: #FAFFA6;
 
}
 
@@ -36,13 +39,10 @@ div.code-body pre .break{
 
	display: block;
 
	
 
}
 

	
 
div.annotatediv{
 
	margin-left:2px;
 
	margin-right:4px;
 
}
 

	
 

	
 
.code-highlight {
 
    padding: 0px;
 
    margin-top: 5px;
 
@@ -55,7 +55,6 @@ div.annotatediv{
 
}
 
.linenos a { text-decoration: none; }
 

	
 

	
 
.code { display: block; }
 
.code-highlight .hll { background-color: #ffffcc }
 
.code-highlight .c { color: #408080; font-style: italic } /* Comment */
0 comments (0 inline, 0 general)