/usr/lib/python2.6/site-packages/pygments/formatters
NameSizeModeActions
bbcode.py33140644editdlrm
bbcode.pyc35800644editdlrm
bbcode.pyo35800644editdlrm
html.py260940644editdlrm
html.pyc245830644editdlrm
html.pyo245830644editdlrm
img.py167640644editdlrm
img.pyc174030644editdlrm
img.pyo174030644editdlrm
latex.py106430644editdlrm
latex.pyc88350644editdlrm
latex.pyo88350644editdlrm
other.py38570644editdlrm
other.pyc47860644editdlrm
other.pyo47860644editdlrm
rtf.py45360644editdlrm
rtf.pyc44250644editdlrm
rtf.pyo44250644editdlrm
svg.py58670644editdlrm
svg.pyc60840644editdlrm
svg.pyo60840644editdlrm
terminal.py40120644editdlrm
terminal.pyc42640644editdlrm
terminal.pyo42640644editdlrm
terminal256.py76040644editdlrm
terminal256.pyc72890644editdlrm
terminal256.pyo72890644editdlrm
_mapping.py55030644editdlrm
_mapping.pyc58800644editdlrm
_mapping.pyo58800644editdlrm
__init__.py18470644editdlrm
__init__.pyc25790644editdlrm
__init__.pyo25790644editdlrm
Edit: /usr/lib/python2.6/site-packages/pygments/formatters/html.py (26094B)
# -*- coding: utf-8 -*- """ pygments.formatters.html ~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for HTML output. :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys, os import StringIO try: set except NameError: from sets import Set as set from pygments.formatter import Formatter from pygments.token import Token, Text, STANDARD_TYPES from pygments.util import get_bool_opt, get_int_opt, get_list_opt, bytes __all__ = ['HtmlFormatter'] def escape_html(text): """Escape &, <, > as well as single and double quotes for HTML.""" return text.replace('&', '&'). \ replace('<', '<'). \ replace('>', '>'). \ replace('"', '"'). \ replace("'", ''') def get_random_id(): """Return a random id for javascript fields.""" from random import random from time import time try: from hashlib import sha1 as sha except ImportError: import sha sha = sha.new return sha('%s|%s' % (random(), time())).hexdigest() def _get_ttype_class(ttype): fname = STANDARD_TYPES.get(ttype) if fname: return fname aname = '' while fname is None: aname = '-' + ttype[-1] + aname ttype = ttype.parent fname = STANDARD_TYPES.get(ttype) return fname + aname CSSFILE_TEMPLATE = '''\ td.linenos { background-color: #f0f0f0; padding-right: 10px; } span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; } pre { line-height: 125%%; } %(styledefs)s ''' DOC_HEADER = '''\ %(title)s

%(title)s

''' DOC_HEADER_EXTERNALCSS = '''\ %(title)s

%(title)s

''' DOC_FOOTER = '''\ ''' class HtmlFormatter(Formatter): r""" 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 ``