Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves Liquid Support #5098

Merged
merged 7 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 54 additions & 3 deletions demo/kitchen-sink/docs/liquid.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
The following examples can be found in full at http://liquidmarkup.org/
There are a couple of different Liquid variations in circulation. This grammars supports
both the Standard and Shopify Liquid variations. The following examples can be found in full at:

Standard Variation: https://shopify.github.io/liquid
Shopify Variation: https://shopify.dev/docs/api/liquid

Liquid is an extraction from the e-commerce system Shopify.
Shopify powers many thousands of e-commerce stores which all call for unique designs.
Expand Down Expand Up @@ -37,11 +41,18 @@ Some more features include:

<h2>If</h2>
<p>
{% if user.name == 'tobi' or user.name == 'marc' %}
{% if user.name == 'tobi' or user.name == 'marc' %}
hi marc or tobi
{% endif %}
</p>

<h2>Comments</h2>

{% # Line Comment %}

{% comment %}
Block Comment
{% endcomment %}

<h2>Case</h2>
<p>
Expand All @@ -58,7 +69,7 @@ Some more features include:

<h2>For Loops</h2>
<p>
{% for item in array %}
{% for item in array %}
{{ item }}
{% endfor %}
</p>
Expand All @@ -74,3 +85,43 @@ Some more features include:
{% endif %}
{% endtablerow %}
</p>

<h2>Embedded Code Blocks</h2>

This support Shopify Liquid variation JSON schema code blocks

{% schema %}
{
"string": "bar",
"boolean": true,
"number": 100,
"object": {
"array": [100, false, "string", {}, [] ]
}
}
{% endschema %}

This support Shopify Liquid variation Stylesheet and Style code blocks

{% style %}
.class {
font-size: 10px; /* comment */
}
{% endstyle %}

{% stylesheet %}
.class {
font-size: 10px; /* comment */
}
{% endstylesheet %}

This support Shopify Liquid variation JavaScript code blocks

{% javascript %}

function foo (param) {

return 'something' // comment
}

{% endjavascript %}
2 changes: 1 addition & 1 deletion src/mode/_test/highlight_rules_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (!fs.existsSync)
require("amd-loader");

var cwd = __dirname + "/";
var root = path.normalize(cwd + Array(5).join("../"));
var root = path.normalize(cwd + Array(4).join("../"));

function jsFileList(path, filter) {
if (!filter) filter = /_test/;
Expand Down
Loading