255 lines
7.1 KiB
JSON
255 lines
7.1 KiB
JSON
{
|
|
"name": "Django txt",
|
|
"scopeName": "text.django",
|
|
"fileTypes": [
|
|
"txt"
|
|
],
|
|
"_comment": "Generated by: poetry run syntax",
|
|
"repository": {
|
|
"django-stuff": {
|
|
"patterns": [
|
|
{
|
|
"begin": "{%\\s*comment ?(\"([\\w\\s])*\" )?\\s*%}",
|
|
"end": "{%\\s*endcomment\\s*%}",
|
|
"name": "comment.block.django"
|
|
},
|
|
{
|
|
"match": "{#.*#}",
|
|
"name": "comment.line.number-sign.django"
|
|
},
|
|
{
|
|
"begin": "{{",
|
|
"end": "}}",
|
|
"name": "storage.type.variable.django",
|
|
"patterns": [
|
|
{
|
|
"include": "#django-template-filter"
|
|
}
|
|
],
|
|
"captures": {
|
|
"0": {
|
|
"name": "entity.tag.tagbraces.django"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"begin": "({%)\\s*(load) ",
|
|
"end": "(%})",
|
|
"name": "storage.type.templatetag.django",
|
|
"patterns": [
|
|
{
|
|
"include": "#django-template-tag-contrib"
|
|
},
|
|
{
|
|
"include": "#django-template-filter"
|
|
}
|
|
],
|
|
"captures": {
|
|
"1": {
|
|
"name": "entity.tag.tagbraces.django"
|
|
},
|
|
"2": {
|
|
"name": "keyword.control.tag-name.django"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"begin": "({%)\\s*(autoescape|endautoescape|block|endblock|blocktrans|endblocktrans|trans|plural|comment|endcomment|debug|extends|filter|firstof|for|empty|endfor|if|elif|else|endif|include|ifchanged|endifchanged|ifequal|endifequal|ifnotequal|endifnotequal|from|low|regroup|ssi|spaceless|endspaceless|templatetag|widthratio|with|endwith|csrf_token|cycle|url|verbatim|endverbatim|lorem|thumbnail|endthumbnail|get_static_prefix)\\b",
|
|
"end": "(%})",
|
|
"name": "storage.type.templatetag.django",
|
|
"patterns": [
|
|
{
|
|
"include": "#string-double-quoted"
|
|
},
|
|
{
|
|
"include": "#string-single-quoted"
|
|
},
|
|
{
|
|
"include": "#django-template-tag"
|
|
},
|
|
{
|
|
"include": "#django-template-filter"
|
|
}
|
|
],
|
|
"captures": {
|
|
"1": {
|
|
"name": "entity.tag.tagbraces.django"
|
|
},
|
|
"2": {
|
|
"name": "keyword.control.tag-name.django"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"begin": "({%)\\s*([a-zA-Z0-9_.]+)",
|
|
"end": "(%})",
|
|
"name": "storage.type.customtemplatetag.django",
|
|
"patterns": [
|
|
{
|
|
"include": "#string-double-quoted"
|
|
},
|
|
{
|
|
"include": "#string-single-quoted"
|
|
},
|
|
{
|
|
"include": "#django-template-tag"
|
|
},
|
|
{
|
|
"include": "#django-template-filter"
|
|
}
|
|
],
|
|
"captures": {
|
|
"1": {
|
|
"name": "entity.tag.tagbraces.django"
|
|
},
|
|
"2": {
|
|
"name": "constant.other.tag.name.django"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"django-template-filter": {
|
|
"patterns": [
|
|
{
|
|
"match": "(\\|) ?(add|addslashes|capfirst|center|cut|date|default|default_if_none|dictsort|dictsortreversed|divisibleby|escape|escapejs|filesizeformat|first|fix_ampersands|floatformat|force_escape|get_digit|iriencode|join|last|length|length_is|linebreaks|linebreaksbr|linenumbers|ljust|lower|make_list|phone2numeric|pluralize|pprint|random|removetags|rjust|safe|safeseq|slice|slugify|stringformat|striptags|time|timesince|timeutil|title|truncatewords|truncatewords_html|unordered_list|upper|urlencode|urlize|urlizetrunc|wordcount|wordwrap|yesno|apnumber|intcomma|intword|naturalday|ordinal|STATIC_PREFIX)\\b",
|
|
"name": "entity.name.function.filter.django",
|
|
"captures": {
|
|
"1": {
|
|
"name": "entity.tag.filter-pipe.django"
|
|
},
|
|
"2": {
|
|
"name": "keyword.control.filter.django"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"match": "(\\|)([a-zA-Z0-9_]+)\\b",
|
|
"name": "entity.name.function.filter.django",
|
|
"captures": {
|
|
"1": {
|
|
"name": "entity.tag.filter-pipe.django"
|
|
},
|
|
"2": {
|
|
"name": "constant.other.filter.django"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"match": ":",
|
|
"name": "keyword.operator.filter-argument.django"
|
|
},
|
|
{
|
|
"match": "=",
|
|
"name": "keyword.operator.assignment.django"
|
|
},
|
|
{
|
|
"match": ",",
|
|
"name": "keyword.operator.argument-separator.django"
|
|
},
|
|
{
|
|
"match": "\\.",
|
|
"name": "keyword.operator.getter.django"
|
|
},
|
|
{
|
|
"match": "[a-zA-Z0-9_]+",
|
|
"name": "string.unquoted.tag-string.django"
|
|
},
|
|
{
|
|
"match": "(>=|>|==|!=|<|<=|and|or|is|not|in)",
|
|
"name": "keyword.operator.condition.django"
|
|
},
|
|
{
|
|
"include": "#string-double-quoted"
|
|
},
|
|
{
|
|
"include": "#string-single-quoted"
|
|
}
|
|
]
|
|
},
|
|
"django-template-tag-contrib": {
|
|
"patterns": [
|
|
{
|
|
"match": "\\b(cache|i18n|l10n|static|tz|flatpages|humanize|admin_list|admin_modify|admin_static|admin_urls|base|log)\\b",
|
|
"name": "constant.other.contrib.django"
|
|
}
|
|
]
|
|
},
|
|
"django-template-tag": {
|
|
"patterns": [
|
|
{
|
|
"match": "\\b(and|or|not|is|in|by|as|asvar|trimmed|with)\\b",
|
|
"name": "keyword.operator.django"
|
|
}
|
|
]
|
|
},
|
|
"string-double-quoted": {
|
|
"begin": "\"",
|
|
"end": "\"",
|
|
"name": "string.quoted.double.html",
|
|
"patterns": [
|
|
{
|
|
"include": "#django-stuff"
|
|
},
|
|
{
|
|
"include": "#entities"
|
|
}
|
|
],
|
|
"beginCaptures": {
|
|
"0": {
|
|
"name": "punctuation.definition.string.begin.html"
|
|
}
|
|
},
|
|
"endCaptures": {
|
|
"0": {
|
|
"name": "punctuation.definition.string.end.html"
|
|
}
|
|
}
|
|
},
|
|
"string-single-quoted": {
|
|
"begin": "'",
|
|
"end": "'",
|
|
"name": "string.quoted.single.html",
|
|
"patterns": [
|
|
{
|
|
"include": "#entities"
|
|
}
|
|
],
|
|
"beginCaptures": {
|
|
"0": {
|
|
"name": "punctuation.definition.string.begin.html"
|
|
}
|
|
},
|
|
"endCaptures": {
|
|
"0": {
|
|
"name": "punctuation.definition.string.end.html"
|
|
}
|
|
}
|
|
},
|
|
"entities": {
|
|
"patterns": [
|
|
{
|
|
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)",
|
|
"name": "constant.character.entity.html",
|
|
"captures": {
|
|
"1": {
|
|
"name": "punctuation.definition.entity.html"
|
|
},
|
|
"3": {
|
|
"name": "punctuation.definition.entity.html"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"match": "&",
|
|
"name": "invalid.illegal.bad-ampersand.html"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#django-stuff"
|
|
}
|
|
]
|
|
} |