Skip to content

Liquid Support #3322

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

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a403ece
split up liquid, the same way php is done
Jun 16, 2017
0cc49da
added html_liquid
Jun 16, 2017
755ea9c
added yaml_liquid
Jun 16, 2017
90ec70f
Revert "added yaml_liquid"
Jun 16, 2017
ead991c
Revert "added html_liquid"
Jun 16, 2017
86d4d1c
Revert "split up liquid, the same way php is done"
Jun 16, 2017
dddfb42
end with newline @ lib/ace/mode/yaml_liquid.js
Jun 16, 2017
de8e20c
added 'variable' to liguid_tag tokens to give it an alternative colour
Jun 16, 2017
dad58d5
better visual support
3limin4t0r Aug 4, 2017
dc9472f
removed space in html_liquid and liquid template
3limin4t0r Aug 4, 2017
9ba0b4b
changed indention
3limin4t0r Aug 4, 2017
75e22e4
fix highlight rule indention
3limin4t0r Aug 4, 2017
caa1d28
liquid_highlight rules fixed function and keyword indention, from 2 t…
3limin4t0r Aug 4, 2017
08ca723
indention return hash
3limin4t0r Aug 4, 2017
2828731
indention endrules
3limin4t0r Aug 4, 2017
5354faa
regenerate liquid tests
3limin4t0r Aug 8, 2017
fcce9df
support for {%- -%} end {{- -}} tags
3limin4t0r Aug 8, 2017
6a5794e
snippets for liquid html_liquid and yaml_liquid
3limin4t0r Aug 8, 2017
b645c31
l- prefix doesn't work on snippet names, changed the prefix to just l
3limin4t0r Aug 8, 2017
c04f606
Merge remote-tracking branch 'upstream/master'
3limin4t0r Aug 18, 2017
c47b2ab
merge master
3limin4t0r Aug 18, 2017
1fec882
Revert "merge master"
3limin4t0r Aug 18, 2017
b83f993
Merge remote-tracking branch 'upstream/master'
3limin4t0r Sep 14, 2018
3cb63ed
update build subproject to 8a271c3dae5267e4a124f378d940f221cc7b3dab
3limin4t0r Sep 14, 2018
f00ce37
merge with upsteam master
3limin4t0r Sep 14, 2018
cff8f8b
fix readme indention
3limin4t0r Sep 14, 2018
ed94718
fix index.html
3limin4t0r Sep 14, 2018
994af24
fix autocomplete
3limin4t0r Sep 14, 2018
121e6a6
fix edit session
3limin4t0r Sep 14, 2018
7c645ee
fix edit session
3limin4t0r Sep 14, 2018
3b50639
update modelist the .liquid need to be prefix with another extention
3limin4t0r Sep 14, 2018
97390ff
fix searchbox
3limin4t0r Sep 14, 2018
2fe5e13
fix searchbox
3limin4t0r Sep 14, 2018
e773361
fix static highlight
3limin4t0r Sep 14, 2018
3e46032
reset unrelated liquid files
3limin4t0r Sep 14, 2018
c48ac33
set modelist to alf order
3limin4t0r Sep 14, 2018
a1e510c
fix travis semicolon errors
3limin4t0r Sep 14, 2018
9a5b5af
yaml liquid mode test
3limin4t0r Sep 14, 2018
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Here's what it looks like:
<h2>{{ product.title }}</h2>
Only {{ product.price | format_as_money }}

<p>{{ product.description | prettyprint | truncate: 200 }}</p>
<p>{{ product.description | prettyprint | truncate: 200 }}</p>

</li>
{% endfor %}
Expand Down
80 changes: 80 additions & 0 deletions demo/kitchen-sink/docs/liquid.txt.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
The following examples can be found in full at http://liquidmarkup.org/

{% comment %}
Default Liquid is plain/text, for the HTML variant select "HTML (Liquid)"
{% endcomment %}

Liquid is an extraction from the e-commerce system Shopify.
Shopify powers many thousands of e-commerce stores which all call for unique designs.
For this we developed Liquid which allows our customers complete design freedom while
maintaining the integrity of our servers.

Liquid has been in production use since June 2006 and is now used by many other
hosted web applications.

It was developed for usage in Ruby on Rails web applications and integrates seamlessly
as a plugin but it also works excellently as a stand alone library.

Here's what it looks like:

<ul id="products">
{% for product in products %}
<li>
<h2>{{ product.title }}</h2>
Only {{ product.price | format_as_money }}

<p>{{ product.description | prettyprint | truncate: 200 }}</p>

</li>
{% endfor %}
</ul>


Some more features include:

<h2>Filters</h2>
<p> The word "tobi" in uppercase: {{ 'tobi' | upcase }} </p>
<p>The word "tobi" has {{ 'tobi' | size }} letters! </p>
<p>Change "Hello world" to "Hi world": {{ 'Hello world' | replace: 'Hello', 'Hi' }} </p>
<p>The date today is {{ 'now' | date: "%Y %b %d" }} </p>


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


<h2>Case</h2>
<p>
{% case template %}
{% when 'index' %}
Welcome
{% when 'product' %}
{{ product.vendor | link_to_vendor }} / {{ product.title }}
{% else %}
{{ page_title }}
{% endcase %}
</p>


<h2>For Loops</h2>
<p>
{% for item in array %}
{{ item }}
{% endfor %}
</p>


<h2>Tables</h2>
<p>
{% tablerow item in items cols: 3 %}
{% if tablerowloop.col_first %}
First column: {{ item.variable }}
{% else %}
Different column: {{ item.variable }}
{% endif %}
{% endtablerow %}
</p>
42 changes: 42 additions & 0 deletions demo/kitchen-sink/docs/yaml_liquid.yaml.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This sample document was taken from wikipedia:
# http://en.wikipedia.org/wiki/YAML#Sample_document
---
receipt: Oz-Ware Purchase Invoice
date: 2007-08-06
customer:
given: Dorothy
family: Gale

items:
- part_no: 'A4786'
descrip: Water Bucket (Filled)
price: 1.47
quantity: 4

- part_no: 'E1628'
descrip: High Heeled "Ruby" Slippers
size: 8
price: 100.27
quantity: 1

{% for item in items %}
- part_no: '{{ item.part_no }}'
descrip: {{ item.descrip }}
price: {{ item.price }}
quantity: {{ iterm.quantity }}
{% endfor %}

bill-to: &id001
street: |
123 Tornado Alley
Suite 16
city: East Centerville
state: KS

ship-to: *id001

specialDelivery: >
Follow the Yellow Brick
Road to the Emerald City.
Pay no attention to the
man behind the curtain.
6 changes: 5 additions & 1 deletion lib/ace/ext/modelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ var supportedModes = {
Hjson: ["hjson"],
HTML: ["html|htm|xhtml|vue|we|wpy"],
HTML_Elixir: ["eex|html.eex"],
HTML_Liquid: ["html.liquid"],
HTML_Ruby: ["erb|rhtml|html.erb"],
INI: ["ini|conf|cfg|prefs"],
Io: ["io"],
Expand All @@ -115,7 +116,7 @@ var supportedModes = {
Kotlin: ["kt|kts"],
LaTeX: ["tex|latex|ltx|bib"],
LESS: ["less"],
Liquid: ["liquid"],
Liquid: ["txt.liquid|text.liquid"],
Lisp: ["lisp"],
LiveScript: ["ls"],
LogiQL: ["logic|lql"],
Expand Down Expand Up @@ -192,6 +193,7 @@ var supportedModes = {
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
XQuery: ["xq"],
YAML: ["yaml|yml"],
YAML_liquid: ["yaml.liquid|yml.liquid"],
// Add the missing mode "Django" to ext-modelist
Django: ["html"]
};
Expand All @@ -207,6 +209,8 @@ var nameOverrides = {
coffee: "CoffeeScript",
HTML_Ruby: "HTML (Ruby)",
HTML_Elixir: "HTML (Elixir)",
HTML_Liquid: "HTML (Liquid)",
YAML_liquid: "YAML (Liquid)",
FTL: "FreeMarker",
PHP_Laravel_blade: "PHP (Blade Template)"
};
Expand Down
Loading