Skip to content

Commit fe3abb9

Browse files
author
deathaxe
authored
Merge pull request #6 from deathaxe/master
Upgrade Liquid for use with ST 4132+
2 parents 9ec1760 + 00c838b commit fe3abb9

33 files changed

+4172
-200
lines changed

.gitattributes

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.github/ export-ignore
2+
/.gitattributes export-ignore
3+
/.gitignore export-ignore
4+
*.cmd export-ignore

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Syntaxes/Markdown (Liquid).sublime-syntax

.python-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.8
+245
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
{
2+
"scope": "meta.filter.liquid",
3+
"completions": [
4+
{
5+
"trigger": "abs",
6+
"kind": ["function", "f", "filter"],
7+
"details": "Returns the absolute value of a number.",
8+
},
9+
{
10+
"trigger": "append",
11+
"kind": ["function", "f", "filter"],
12+
"details": "Adds the specified string to the end of another string.",
13+
},
14+
{
15+
"trigger": "at_least",
16+
"kind": ["function", "f", "filter"],
17+
"details": "Limits a number to a minimum value.",
18+
},
19+
{
20+
"trigger": "at_most",
21+
"kind": ["function", "f", "filter"],
22+
"details": "Limits a number to a maximum value.",
23+
},
24+
{
25+
"trigger": "capitalize",
26+
"kind": ["function", "f", "filter"],
27+
"details": "Makes the first character of a string capitalized and converts the remaining characters to lowercase.",
28+
},
29+
{
30+
"trigger": "ceil",
31+
"kind": ["function", "f", "filter"],
32+
"details": "Rounds an input up to the nearest whole number.",
33+
},
34+
{
35+
"trigger": "compact",
36+
"kind": ["function", "f", "filter"],
37+
"details": "Removes any <code>nil</code> values from an array.",
38+
},
39+
{
40+
"trigger": "concat",
41+
"kind": ["function", "f", "filter"],
42+
"details": "Concatenates (joins together) multiple arrays.",
43+
},
44+
{
45+
"trigger": "date",
46+
"kind": ["function", "f", "filter"],
47+
"details": "Converts a timestamp into another date format.",
48+
},
49+
{
50+
"trigger": "default",
51+
"kind": ["function", "f", "filter"],
52+
"details": "Sets a default value for any variable with no assigned value.",
53+
},
54+
{
55+
"trigger": "divided_by",
56+
"kind": ["function", "f", "filter"],
57+
"details": "Divides a number by another number.",
58+
},
59+
{
60+
"trigger": "downcase",
61+
"kind": ["function", "f", "filter"],
62+
"details": "Makes each character in a string lowercase.",
63+
},
64+
{
65+
"trigger": "escape",
66+
"kind": ["function", "f", "filter"],
67+
"details": "Escapes a string by replacing characters with escape sequences.",
68+
},
69+
{
70+
"trigger": "escape_once",
71+
"kind": ["function", "f", "filter"],
72+
"details": "Escapes a string without changing existing escaped entities.",
73+
},
74+
{
75+
"trigger": "first",
76+
"kind": ["function", "f", "filter"],
77+
"details": "Returns the first item of an array.",
78+
},
79+
{
80+
"trigger": "floor",
81+
"kind": ["function", "f", "filter"],
82+
"details": "Rounds an input down to the nearest whole number.",
83+
},
84+
{
85+
"trigger": "join",
86+
"kind": ["function", "f", "filter"],
87+
"details": "Combines the items in an array into a single string using the argument as a separator.",
88+
},
89+
{
90+
"trigger": "last",
91+
"kind": ["function", "f", "filter"],
92+
"details": "Returns the last item of an array.",
93+
},
94+
{
95+
"trigger": "lstrip",
96+
"kind": ["function", "f", "filter"],
97+
"details": "Removes all whitespace (tabs, spaces, and newlines) from the <b>left</b> side of a string.",
98+
},
99+
{
100+
"trigger": "map",
101+
"kind": ["function", "f", "filter"],
102+
"details": "Creates an array of values by extracting the values of a named property from another object.",
103+
},
104+
{
105+
"trigger": "minus",
106+
"kind": ["function", "f", "filter"],
107+
"details": "Subtracts a number from another number.",
108+
},
109+
{
110+
"trigger": "modulo",
111+
"kind": ["function", "f", "filter"],
112+
"details": "Returns the remainder of a division operation.",
113+
},
114+
{
115+
"trigger": "newline_to_br",
116+
"kind": ["function", "f", "filter"],
117+
"details": "Inserts an HTML line break (<code>&lt;br /&gt;</code>) in front of each newline (<code>\\n</code>) in a string.",
118+
},
119+
{
120+
"trigger": "plus",
121+
"kind": ["function", "f", "filter"],
122+
"details": "Adds a number to another number.",
123+
},
124+
{
125+
"trigger": "prepend",
126+
"kind": ["function", "f", "filter"],
127+
"details": "Adds the specified string to the beginning of another string.",
128+
},
129+
{
130+
"trigger": "remove",
131+
"kind": ["function", "f", "filter"],
132+
"details": "Removes every occurrence of the specified substring from a string.",
133+
},
134+
{
135+
"trigger": "remove_first",
136+
"kind": ["function", "f", "filter"],
137+
"details": "Removes only the first occurrence of the specified substring from a string.",
138+
},
139+
{
140+
"trigger": "replace",
141+
"kind": ["function", "f", "filter"],
142+
"details": "Replaces every occurrence of the first argument in a string with the second argument.",
143+
},
144+
{
145+
"trigger": "replace_first",
146+
"kind": ["function", "f", "filter"],
147+
"details": "Replaces only the first occurrence of the first argument in a string with the second argument.",
148+
},
149+
{
150+
"trigger": "reverse",
151+
"kind": ["function", "f", "filter"],
152+
"details": "Reverses the order of the items in an array.",
153+
},
154+
{
155+
"trigger": "round",
156+
"kind": ["function", "f", "filter"],
157+
"details": "Rounds a number to the nearest integer or, if a number is passed as an argument, to that number of decimal places.",
158+
},
159+
{
160+
"trigger": "rstrip",
161+
"kind": ["function", "f", "filter"],
162+
"details": "Removes all whitespace (tabs, spaces, and newlines) from the <b>right</b> side of a string.",
163+
},
164+
{
165+
"trigger": "size",
166+
"kind": ["function", "f", "filter"],
167+
"details": "Returns the number of characters in a string or the number of items in an array.",
168+
},
169+
{
170+
"trigger": "slice",
171+
"kind": ["function", "f", "filter"],
172+
"details": "Returns a substring of one character or series of array items.",
173+
},
174+
{
175+
"trigger": "sort",
176+
"kind": ["function", "f", "filter"],
177+
"details": "Sorts items in an array in case-sensitive order.",
178+
},
179+
{
180+
"trigger": "sort_natural",
181+
"kind": ["function", "f", "filter"],
182+
"details": "Sorts items in an array in case-insensitive order.",
183+
},
184+
{
185+
"trigger": "split",
186+
"kind": ["function", "f", "filter"],
187+
"details": "Divides a string into an array using the argument as a separator.",
188+
},
189+
{
190+
"trigger": "strip",
191+
"kind": ["function", "f", "filter"],
192+
"details": "Removes all whitespace (tabs, spaces, and newlines) from both the left and right sides of a string.",
193+
},
194+
{
195+
"trigger": "strip_html",
196+
"kind": ["function", "f", "filter"],
197+
"details": "Removes any HTML tags from a string.",
198+
},
199+
{
200+
"trigger": "strip_newlines",
201+
"kind": ["function", "f", "filter"],
202+
"details": "Removes any newline characters (line breaks) from a string.",
203+
},
204+
{
205+
"trigger": "times",
206+
"kind": ["function", "f", "filter"],
207+
"details": "Multiplies a number by another number.",
208+
},
209+
{
210+
"trigger": "truncate",
211+
"kind": ["function", "f", "filter"],
212+
"details": "Shortens a string down to the number of characters passed as an argument.",
213+
},
214+
{
215+
"trigger": "truncatewords",
216+
"kind": ["function", "f", "filter"],
217+
"details": "Shortens a string down to the number of words passed as an argument.",
218+
},
219+
{
220+
"trigger": "uniq",
221+
"kind": ["function", "f", "filter"],
222+
"details": "Removes any duplicate items in an array.",
223+
},
224+
{
225+
"trigger": "upcase",
226+
"kind": ["function", "f", "filter"],
227+
"details": "Makes each character in a string uppercase.",
228+
},
229+
{
230+
"trigger": "url_decode",
231+
"kind": ["function", "f", "filter"],
232+
"details": "Decodes a string that has been encoded as a URL or by <code>url_encode</code>.",
233+
},
234+
{
235+
"trigger": "url_encode",
236+
"kind": ["function", "f", "filter"],
237+
"details": "Converts any URL-unsafe characters in a string into percent-encoded characters.",
238+
},
239+
{
240+
"trigger": "where",
241+
"kind": ["function", "f", "filter"],
242+
"details": "Creates an array including only the objects with a given property value, or any truthy value by default.",
243+
},
244+
]
245+
}

LICENSE

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
MIT License
1+
The MIT License (MIT)
22

3-
Copyright (c) 2022 Sublime Text Packages
3+
Copyright (c) 2010 Shopify, Inc
4+
2022 DeathAxe
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal

README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
# Liquid (and front matter for Jekyll) syntax for Sublime Text
1+
# Liquid/Jekyll syntax for Sublime Text
22

3-
Provides syntax highlighting for HTML and Markdown files with [Shopify Liquid](https://shopify.github.io/liquid/) template tags.
3+
Provides syntax highlighting for HTML and Markdown files with [Shopify Liquid](https://shopify.github.io/liquid/) and [Jekyll](https://jekyllrb.com/docs/liquid/) template tags.
44

5-
For working with [Jekyll](https://jekyllrb.com), this package will also provides proper syntax highlighting for yaml front matter.
5+
For working with [Jekyll](https://jekyllrb.com), this package also provides proper syntax highlighting for yaml front matter.
6+
7+
![](preview.png)
68

79
## Usage
810

9-
To enable the syntax, select "Liquid > Liquid HTML" (or Markdown) from the syntax selection menu, or via the command palette.
10-
To always open your templates with this syntax, use the "Open all with current extension as ..." option, and select the proper Liquid syntax.
11+
To enable the syntax, select `Liquid > HTML (Liquid)` or `Liquid > Markdown (Liquid)` from syntax selection menu or via Command Palette.
12+
13+
To always open your templates with this syntax, use the `Open all with current extension as ...` option, and select the proper Liquid syntax.

Snippets/assign.sublime-snippet

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
]]></content>
55
<tabTrigger>assign</tabTrigger>
66
<description>liquid assign</description>
7-
<scope>text.html</scope>
7+
<scope>(text.html.liquid | text.html.markdown.liquid | source.css.liquid | source.js.liquid) - (meta.tag.liquid | meta.object.liquid)</scope>
88
</snippet>

Snippets/capture.sublime-snippet

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
]]></content>
77
<tabTrigger>capture</tabTrigger>
88
<description>liquid capture</description>
9-
<scope>text.html</scope>
9+
<scope>(text.html.liquid | text.html.markdown.liquid | source.css.liquid | source.js.liquid) - (meta.tag.liquid | meta.object.liquid)</scope>
1010
</snippet>

Snippets/case.sublime-snippet

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
]]></content>
88
<tabTrigger>case</tabTrigger>
99
<description>liquid case switch</description>
10-
<scope>text.html</scope>
10+
<scope>(text.html.liquid | text.html.markdown.liquid | source.css.liquid | source.js.liquid) - (meta.tag.liquid | meta.object.liquid)</scope>
1111
</snippet>

Snippets/content_for_layout.sublime-snippet

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
]]></content>
55
<tabTrigger>cfl</tabTrigger>
66
<description>liquid content_for_layout</description>
7-
<scope>text.html</scope>
7+
<scope>(text.html.liquid | text.html.markdown.liquid | source.css.liquid | source.js.liquid) - (meta.tag.liquid | meta.object.liquid)</scope>
88
</snippet>

Snippets/cycle.sublime-snippet

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
]]></content>
55
<tabTrigger>cycle</tabTrigger>
66
<description>liquid cycle</description>
7-
<scope>text.html</scope>
7+
<scope>(text.html.liquid | text.html.markdown.liquid | source.css.liquid | source.js.liquid) - (meta.tag.liquid | meta.object.liquid)</scope>
88
</snippet>

Snippets/for.sublime-snippet

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
]]></content>
77
<tabTrigger>for</tabTrigger>
88
<description>liquid for loop</description>
9-
<scope>text.html</scope>
9+
<scope>(text.html.liquid | text.html.markdown.liquid | source.css.liquid | source.js.liquid) - (meta.tag.liquid | meta.object.liquid)</scope>
1010
</snippet>

Snippets/if.sublime-snippet

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
]]></content>
77
<tabTrigger>if</tabTrigger>
88
<description>liquid if</description>
9-
<scope>text.html</scope>
9+
<scope>(text.html.liquid | text.html.markdown.liquid | source.css.liquid | source.js.liquid) - (meta.tag.liquid | meta.object.liquid)</scope>
1010
</snippet>

Snippets/ifelse.sublime-snippet

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
]]></content>
99
<tabTrigger>ifelse</tabTrigger>
1010
<description>liquid if else</description>
11-
<scope>text.html</scope>
11+
<scope>(text.html.liquid | text.html.markdown.liquid | source.css.liquid | source.js.liquid) - (meta.tag.liquid | meta.object.liquid)</scope>
1212
</snippet>

Snippets/include.sublime-snippet

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
]]></content>
55
<tabTrigger>include</tabTrigger>
66
<description>liquid include</description>
7-
<scope>text.html</scope>
7+
<scope>(text.html.liquid | text.html.markdown.liquid | source.css.liquid | source.js.liquid) - (meta.tag.liquid | meta.object.liquid)</scope>
88
</snippet>

Snippets/named cycle.sublime-snippet

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
]]></content>
55
<tabTrigger>named</tabTrigger>
66
<description>liquid named cycle</description>
7-
<scope>text.html</scope>
7+
<scope>(text.html.liquid | text.html.markdown.liquid | source.css.liquid | source.js.liquid) - (meta.tag.liquid | meta.object.liquid)</scope>
88
</snippet>

Snippets/unless.sublime-snippet

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
]]></content>
77
<tabTrigger>unless</tabTrigger>
88
<description>liquid unless</description>
9-
<scope>text.html</scope>
9+
<scope>(text.html.liquid | text.html.markdown.liquid | source.css.liquid | source.js.liquid) - (meta.tag.liquid | meta.object.liquid)</scope>
1010
</snippet>

Snippets/when.sublime-snippet

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
]]></content>
66
<tabTrigger>when</tabTrigger>
77
<description>liquid when</description>
8-
<scope>text.html</scope>
8+
<scope>(text.html.liquid | text.html.markdown.liquid | source.css.liquid | source.js.liquid) - (meta.tag.liquid | meta.object.liquid)</scope>
99
</snippet>

Syntaxes/CSS (Liquid).sublime-syntax

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
%YAML 1.2
2+
---
3+
# http://www.sublimetext.com/docs/syntax.html
4+
name: CSS (Liquid)
5+
scope: source.css.liquid
6+
version: 2
7+
8+
extends: Packages/CSS/CSS.sublime-syntax
9+
10+
file_extensions:
11+
- css.liquid
12+
- liquid.css
13+
14+
contexts:
15+
16+
prototype:
17+
- meta_prepend: true
18+
- include: scope:source.liquid
19+
20+
string-content:
21+
- meta_prepend: true
22+
- include: scope:source.liquid#interpolations

0 commit comments

Comments
 (0)