Skip to content

Instantly share code, notes, and snippets.

@actuosus
Created May 28, 2010 13:01
Show Gist options
  • Save actuosus/417119 to your computer and use it in GitHub Desktop.
Save actuosus/417119 to your computer and use it in GitHub Desktop.
XPTemplate priority=lang-
let s:f = g:XPTfuncs()
XPTvar $CL {#
XPTvar $CR #}
XPTinclude
\ _comment/doubleSign
XPTinclude
\ _common/common
\ xml/xml
XPTembed
\ html/html
XPT django_tag hidden " {% $_xSnipName %}..{% end$_xSnipName %}
{% `$_xSnipName^ %}`cursor^{% end`$_xSnipName^ %}
..XPT
XPT django_short_tag hidden " {% $_xSnipName .. %}
{% `$_xSnipName^ `cursor^%}
XPT autoescape alias=django_tag
XPT block
{% block `name^ %}
`cursor^
{%endblock `name^ %}
XPT comment_line syn=comment
XPT comment alias=django_tag
XPT csrf_token alias=django_short_tag
" cycle
XPT debug alias=django_short_tag
XPT extends
{% extends '`template_path^' %}
XPT filter " Outputs the first variable passed that is not False, without escaping.
{% filter `filters_set^ %}
{% endfilter %}
XPT firstof
{% firstof `var_set^ %}
XPT for
{% for `item^ in `range^ %}
{{ `item^`cursor^ }}
{% endfor %}
XPT for " for ... empty
{% for `item^ in `range^ %}
{{ `item^`cursor^ }}
{% empty %}
`empty_range^
{% endfor %}
XPT if
{% if `condition^ %}
`so^
{% else %}
`otherwise^
{%endif}
XPT include
{% include '`cursor^' %}
XPT ifchanged alias=django_tag
XPT ifequal alias=django_tag
XPT ifnotequal alias=django_tag
XPT load " Load a custom template tag set.
{% load `cursor^ %}
XPT now " Display the date, formatted according to the given string.
{% now '`format^' %}
XPT regroup " Regroup a list of alike objects by a common attribute.
{% regroup `item^ by `key^ as `list_name^ %}
XPT spaceless alias=django_tag hint=Removes whitespace between HTML tags. This includes tab characters and newlines.
XPT ssi " Output the contents of a given file into the page.
{% ssi `file_path^ %}
XPT templatetag " Output one of the syntax characters used to compose template tags.
XPT url " Returns an resolved absolute URL
{% url `view_path^ `params?^ %}
XPT widthratio " Width calculator
{% widthratio `this_value^ `max_value^ `ratio^ %}
XPT with " Caches a complex variable under a simpler name.
{% with `complex_name^ as `simple_name^ %}
`expression^
{% endwith %}
XPT trans
{% trans "`cursor^" %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment