'Pass code to the [Pygments](http://pygments.pocoo.org/) highliter with
optional line numbers. The output should then be styled with css to
your liking. No styles are applied by default - only styling hooks
(i.e.: <span class="k">).
returns : A string of html.'

def hilite(self):

    self.src = self.src.strip('\n')
    self._getLang()
    try:
        from pygments import highlight
        from pygments.lexers import get_lexer_by_name, guess_lexer, TextLexer
        from pygments.formatters import HtmlFormatter
    except ImportError:
        txt = self._escape(self.src)
        if self.linenos:
            txt = self._number(txt)
        else:
            txt = ('<div    class="%s"><pre>%s</pre></div>\n' % (self.css_class, txt))
        return txt
    else:
        try:
            lexer = get_lexer_by_name(self.lang)
        except ValueError:
            try:
                lexer = guess_lexer(self.src)
            except ValueError:
                lexer = TextLexer()
        formatter = HtmlFormatter(linenos=self.linenos, cssclass=self.css_class)
        return highlight(self.src, lexer, formatter)
