-
Notifications
You must be signed in to change notification settings - Fork 8
/
snippets.json
171 lines (151 loc) · 2.59 KB
/
snippets.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
{
"jinja block": {
"prefix": "jblock",
"body": [
"{% block $1 %}",
"\t$2",
"{% endblock $1 %}$0"
],
"description": "jinja block"
},
"jinja set": {
"prefix": "jset",
"body": [
"{% set $1 = $2 %}$0"
],
"description": "jinja set"
},
"jinja if": {
"prefix": "jif",
"body": [
"{% if $1 %}",
"\t$2",
"{% endif %}$0"
],
"description": "jinja if"
},
"jinja if else": {
"prefix": "jifelse",
"body": [
"{% if $1 %}",
"\t$2",
"{% else %}",
"\t$3",
"{% endif %}$0"
],
"description": "jinja if else"
},
"jinja extends": {
"prefix": "jextend",
"body": [
"{% extends '$1.html' %}$0"
],
"description": "jinja extends"
},
"jinja for loop": {
"prefix": "jfor",
"body": [
"{% for $1 in $2 %}",
"\t$3",
"{% endfor %}$0"
],
"description": "jinja for loop"
},
"jinja random": {
"prefix": "jrandom",
"body": [
"{{ range($1, $2) | random }}$0"
],
"description": "jinja random number generator"
},
"jinja print": {
"prefix": ["jprint","jvar"],
"body": [
"{{ $1 }}$0"
],
"description": "jinja print variable"
},
"jinja func": {
"prefix": "jfunc",
"body": [
"{% $1 %}$0"
],
"description": "jinja function wrapper"
},
"jinja macros": {
"prefix": "jmacro",
"body": [
"{% macro $1 %}",
"\t$2",
"{% endmacro %}$0"
],
"description": "jinja macro block"
},
"jinja round": {
"prefix": "jround",
"body": [
"{% $1 | round %}$0"
],
"description": "jinja round a float"
},
"jinja join list": {
"prefix": "jjoin",
"body": [
"{% $1 | join(',') %}$0"
],
"description": "jinja join a list"
},
"jinja url": {
"prefix": "jurl",
"body": [
"{{ url_for('$1', filename='$2') }}$0"
],
"description": "jinja url for"
},
"jinja call": {
"prefix": "jcall",
"body": [
"{% call $1 %}",
"\t$2",
"{% endcall %}$0"
],
"description": "jinja call"
},
"jinja filter": {
"prefix": "jfilter",
"body": [
"{% filter $1 %}",
"\t$2",
"{% endfilter %}$0"
],
"description": "jinja filter"
},
"jinja include": {
"prefix": "jinclude",
"body": [
"{% include '$1.html' %}$0"
],
"description": "jinja include"
},
"jinja from": {
"prefix": "jfrom",
"body": [
"{% from '$1' import $2 %}$0"
],
"description": "jinja from"
},
"jinja image": {
"prefix": "jimg",
"body": [
"<img src=\"{{ url_for('static', filename='$1') }}\" alt=\"$2\">$0"
],
"description": "img tag with url_for"
},
"jinja href": {
"prefix": "jhref",
"body": [
"<a href=\"{{ url_for('$1') }}\">$2</a>$0"
],
"description": "a tag with url_for"
}
}