fJc @sdZddkZddkZddkZyeWn#ej oddklZnXddkl Z ddk l Z l Z l Z ddklZlZlZlZdgZdZd Zd Zd Zd ed ZdZdZde fdYZdS(s pygments.formatters.html ~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for HTML output. :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. iN(tSet(t Formatter(tTokentTexttSTANDARD_TYPES(t get_bool_optt get_int_optt get_list_opttbytest HtmlFormattercCs@|iddiddiddiddid d S( s<Escape &, <, > as well as single and double quotes for HTML.t&s&ts>t"s"t's'(treplace(ttext((s</usr/lib/python2.6/site-packages/pygments/formatters/html.pyt escape_htmls    c Csddkl}ddkl}yddkl}Wn(tj oddk}|i}nX|d||fiS(s)Return a random id for javascript fields.i(trandom(ttime(tsha1Ns%s|%s(RRthashlibRt ImportErrortshatnewt hexdigest(RRR((s</usr/lib/python2.6/site-packages/pygments/formatters/html.pyt get_random_id$s cCshti|}|o|Sd}x<|djo.d|d|}|i}ti|}q$W||S(Ntt-i(RtgettNonetparent(tttypetfnametaname((s</usr/lib/python2.6/site-packages/pygments/formatters/html.pyt_get_ttype_class0s  std.linenos { background-color: #f0f0f0; padding-right: 10px; } span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; } pre { line-height: 125%%; } %(styledefs)s s %(title)s

%(title)s

s5 %(title)s

%(title)s

s cBseZdZdZdgZddgZdZdZdZddZ d Z d Z d Z d Zd ZdZdZdZdZdZdZRS(s\$ Format tokens as HTML 4 ```` tags within a ``
`` tag, wrapped
    in a ``
`` tag. The ``
``'s CSS class can be set by the `cssclass` option. If the `linenos` option is set to ``"table"``, the ``
`` is
    additionally wrapped inside a ```` which has one row and two
    cells: one containing the line numbers and one containing the code.
    Example:

    .. sourcecode:: html

        
1
            2
def foo(bar):
              pass
            
(whitespace added to improve clarity). Wrapping can be disabled using the `nowrap` option. A list of lines can be specified using the `hl_lines` option to make these lines highlighted (as of Pygments 0.11). With the `full` option, a complete HTML 4 document is output, including the style definitions inside a ``