# Path: native_tags/decorators.py
# def tag(bucket, doc):
#     def wrapped(inner, **options):


    from pygments.formatters import HtmlFormatter
    from pygments.lexers import get_lexer_by_name
    from pygments import highlight as highlighter
from native_tags.decorators import function, block
        Syntax::

            {% highlight_style [cssclass] [formatter options] %}

        Example::

            {% highlight_style code linenos=true %}
    """
    if highlighter is None:
        return ''
    return HtmlFormatter(**kwargs).get_style_defs('.%s' % cssclass)
highlight_style = function(highlight_style)

def highlight(code, lexer, **kwargs):
    """
    Returns highlighted code ``div`` tag from ``HtmlFormatter``
    Lexer is guessed by ``lexer`` name
    arguments are passed into the formatter

        Syntax::

            {% highlight [source code] [lexer name] [formatter options] %}

        Example::

            {% highlight 'print "Hello World"' python linenos=true %}
    """
    if highlighter is None:
        return '<pre>%s</pre>' % code
    return highlighter(code or '', get_lexer_by_name(lexer), HtmlFormatter(**kwargs))

# Path: native_tags/decorators.py
# def tag(bucket, doc):
#     def wrapped(inner, **options):


# Path: native_tags/contrib/pygmentize.py
    from pygments.formatters import HtmlFormatter
    from pygments.lexers import get_lexer_by_name
    from pygments import highlight as highlighter
from native_tags.decorators import function, block

        Syntax::

            {% highlight_style [cssclass] [formatter options] %}

        Example::

            {% highlight_style code linenos=true %}
    """
    if highlighter is None:
        return ''
    return HtmlFormatter(**kwargs).get_style_defs('.%s' % cssclass)
highlight_style = function(highlight_style)

def highlight(code, lexer, **kwargs):
    """
    Returns highlighted code ``div`` tag from ``HtmlFormatter``
    Lexer is guessed by ``lexer`` name
    arguments are passed into the formatter

        Syntax::

            {% highlight [source code] [lexer name] [formatter options] %}

        Example::

            {% highlight 'print "Hello World"' python linenos=true %}
    """
    if highlighter is None:
        return '<pre>%s</pre>' % code
    return highlighter(code or '', get_lexer_by_name(lexer), HtmlFormatter(**kwargs))

highlight = function(highlight, is_safe=True)