Skip to content

Commit cf0d783

Browse files
author
Jerry Lopez
authored
Merge pull request #1 from jerrylopez/structure-in-directories
Organize snippets into separate files
2 parents 38e9436 + 262c3ae commit cf0d783

File tree

10 files changed

+298
-153
lines changed

10 files changed

+298
-153
lines changed

package.json

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,35 @@
2323
"snippets": [
2424
{
2525
"language": "xml",
26-
"path": "./snippets/layout.json"
26+
"path": "./snippets/layout/arguement.json"
27+
},
28+
{
29+
"language": "xml",
30+
"path": "./snippets/layout/attribute.json"
31+
},
32+
{
33+
"language": "xml",
34+
"path": "./snippets/layout/block.json"
35+
},
36+
{
37+
"language": "xml",
38+
"path": "./snippets/layout/container.json"
39+
},
40+
{
41+
"language": "xml",
42+
"path": "./snippets/layout/move.json"
43+
},
44+
{
45+
"language": "xml",
46+
"path": "./snippets/layout/remove.json"
47+
},
48+
{
49+
"language": "xml",
50+
"path": "./snippets/layout/scaffold.json"
51+
},
52+
{
53+
"language": "xml",
54+
"path": "./snippets/layout/update.json"
2755
}
2856
]
2957
}

snippets/layout.json

Lines changed: 0 additions & 152 deletions
This file was deleted.

snippets/layout/arguement.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"Arguements": {
3+
"prefix": "m2.layout.args",
4+
"body": [
5+
"<arguments>",
6+
"\t$0",
7+
"</arguments>"
8+
],
9+
"description": "Includes a certain layout file"
10+
},
11+
12+
"Arguement": {
13+
"prefix": "m2.layout.arg",
14+
"body": [
15+
"<argument name=\"${1:name}\" xsi:type=\"${2:type|string,boolean,object,number,null,array|}\">$0</argument>",
16+
],
17+
"description": "Includes a certain layout file"
18+
}
19+
}

snippets/layout/attribute.json

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
{
2+
"Translate": {
3+
"prefix": "m2.layout.attr.translate",
4+
"body": [
5+
"translate=\"${2:boolean|true,false|}\""
6+
],
7+
"description": "Translate attribute"
8+
},
9+
10+
"xsi:type": {
11+
"prefix": "m2.layout.attr.xsi:type",
12+
"body": [
13+
"xsi:type=\"${2:type|string,boolean,object,number,null,array|}\""
14+
],
15+
"description": "xsi:type attribute"
16+
},
17+
18+
"Handle": {
19+
"prefix": "m2.layout.attr.handle",
20+
"body": [
21+
"handle=\"$1\"$0"
22+
],
23+
"description": "Handle attribute"
24+
},
25+
26+
"Destination": {
27+
"prefix": "m2.layout.attr.destination",
28+
"body": [
29+
"destination=\"$1\"$0"
30+
],
31+
"description": "Destination attribute"
32+
},
33+
34+
"Element": {
35+
"prefix": "m2.layout.attr.element",
36+
"body": [
37+
"element=\"$1\"$0"
38+
],
39+
"description": "Element attribute"
40+
},
41+
42+
"htmlId": {
43+
"prefix": "m2.layout.attr.htmlId",
44+
"body": [
45+
"htmlId=\"$1\"$0"
46+
],
47+
"description": "htmlId attribute"
48+
},
49+
50+
"htmlClass": {
51+
"prefix": "m2.layout.attr.htmlClass",
52+
"body": [
53+
"htmlClass=\"$1\"$0"
54+
],
55+
"description": "htmlClass attribute"
56+
},
57+
58+
"htmlTag": {
59+
"prefix": "m2.layout.attr.htmlTag",
60+
"body": [
61+
"htmlTag=\"$1\"$0"
62+
],
63+
"description": "htmlTag attribute"
64+
},
65+
66+
"Output": {
67+
"prefix": "m2.layout.attr.output",
68+
"body": [
69+
"output=\"${1:|1,0|}\"$0"
70+
],
71+
"description": "Output attribute"
72+
},
73+
74+
"Label": {
75+
"prefix": "m2.layout.attr.label",
76+
"body": [
77+
"label=\"$1\"$0"
78+
],
79+
"description": "Label attribute"
80+
},
81+
82+
"As": {
83+
"prefix": "m2.layout.attr.as",
84+
"body": [
85+
"as=\"$1\"$0"
86+
],
87+
"description": "As attribute"
88+
},
89+
90+
"Template": {
91+
"prefix": "m2.layout.attr.template",
92+
"body": [
93+
"template=\"$1\"$0"
94+
],
95+
"description": "Template attribute"
96+
},
97+
98+
"Class": {
99+
"prefix": "m2.layout.attr.class",
100+
"body": [
101+
"class=\"$1\"$0"
102+
],
103+
"description": "Class attribute"
104+
},
105+
106+
"Name": {
107+
"prefix": "m2.layout.attr.name",
108+
"body": [
109+
"name=\"$1\"$0"
110+
],
111+
"description": "Name attribute"
112+
},
113+
114+
"Before": {
115+
"prefix": "m2.layout.attr.before",
116+
"body": [
117+
"before=\"${1:|dash(-),element,empty|}\"$0"
118+
],
119+
"description": "Before attribute"
120+
},
121+
122+
"After": {
123+
"prefix": "m2.layout.attr.after",
124+
"body": [
125+
"after=\"${1:|dash(-),element,empty|}\"$0"
126+
],
127+
"description": "After attribute"
128+
},
129+
130+
"Cacheable": {
131+
"prefix": "m2.layout.attr.cacheable",
132+
"body": [
133+
"cacheable=\"${boolean:|true,false|}\"$0"
134+
],
135+
"description": "Cacheable attribute"
136+
},
137+
138+
"Display": {
139+
"prefix": "m2.layout.attr.display",
140+
"body": [
141+
"display=\"${boolean:|true,false|}\"$0"
142+
],
143+
"description": "Display attribute"
144+
},
145+
146+
"Remove": {
147+
"prefix": "m2.layout.attr.remove",
148+
"body": [
149+
"remove=\"${boolean:|true,false|}\"$0"
150+
],
151+
"description": "Remove attribute"
152+
}
153+
}

snippets/layout/block.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"Block": {
3+
"prefix": "m2.layout.block",
4+
"body": [
5+
"<block class=\"$1\" name=\"$3\" as=\"$5\" template=\"$7\" />$0",
6+
],
7+
"description": "Defines a block"
8+
},
9+
10+
"Block Wrap": {
11+
"prefix": "m2.layout.blockWrap",
12+
"body": [
13+
"<block class=\"$1\" name=\"$3\" as=\"$5\" template=\"$7\" />",
14+
"\t$0",
15+
"</block>"
16+
],
17+
"description": "Defines a wrapping block"
18+
},
19+
20+
"Reference Block": {
21+
"prefix": "m2.layout.refBlock",
22+
"body": [
23+
"<referenceBlock name=\"$1\">",
24+
"\t$0",
25+
"</referenceBlock>"
26+
],
27+
"description": "Targets blocks and applies updates specified"
28+
}
29+
}

0 commit comments

Comments
 (0)