o aމ @sdZddlZddlZddlZddlZddlmZddlmZddl m Z m Z m Z ddl mZmZmZzddlZWn eyCdZYnwdgZedd ed d ed d eddeddiZefddZddZddZdZdedZdZdZGdddeZdS)z pygments.formatters.html ~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for HTML output. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N)StringIO) Formatter)TokenTextSTANDARD_TYPES) get_bool_opt get_int_opt get_list_opt HtmlFormatter&z&z>"z"'z'cCs ||S)z as well as single and double quotes for HTML.) translate)texttabler:/usr/lib/python3/dist-packages/pygments/formatters/html.py escape_html&s rcCs |ds |dr |Sd|S)Ncalcvar#) startswith)colorrrrwebify+srcCsNt|}|r |Sd}|dur#d|d|}|j}t|}|dus||S)N-)rgetparent)ttypefnameanamerrr_get_ttype_class2s  r$z/* generated by Pygments Copyright 2006-2021 by the Pygments team. Licensed under the BSD license, see LICENSE for details. */ %(styledefs)s a %(title)s

%(title)s

a5 %(title)s

%(title)s

z c@s eZdZdZdZdgZddgZddZdd Zd d Z d d Z ddZ dAddZ dAddZ dAddZddZddZeddZeddZedd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zejd3d4d5d6Z d7d8Z!d9d:Z"d;d<Z#d=d>Z$d?d@Z%dS)Br aS, 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 ``