@register.tag('capture')
def do_capture(parser, token):
    """
    Captures content into a context variable.
    
    Syntax:

        {% capture as [foo] %}{% endcapture %}

    Usage:
        
        {% capture as content %}
            {% block content %}{% endblock %}
        {% endcapture %}
    """
    bits = token.split_contents()
    if len(bits) != 3:
        raise template.TemplateSyntaxError("'capture' node requires `as (variable name)`.")
    nodelist = parser.parse(('endcapture',))
    parser.delete_first_token()
    return CaptureNode(nodelist, bits[2])
dataset/ETHPy150Open hzlf/openbroadcast/website/apps/tools/templatetags/capture.py/do_capture/original