Skip to content

Commit ed15918

Browse files
committed
Update liquid to 5.0
Add prism highlight for liquid
1 parent c49736b commit ed15918

5 files changed

Lines changed: 20 additions & 2 deletions

File tree

assets/javascripts/vendor/prism.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3186,6 +3186,19 @@ Prism.languages.sql = {
31863186
'punctuation': /[;[\]()`,.]/
31873187
};
31883188

3189+
Prism.languages.liquid = {
3190+
keyword:/\b(?:comment|endcomment|if|elsif|else|endif|unless|endunless|for|endfor|case|endcase|when|in|break|assign|continue|limit|offset|range|reversed|raw|endraw|capture|endcapture|tablerow|endtablerow)\b/,
3191+
number:/\b0b[01]+\b|\b0x(?:\.[\da-fp-]+|[\da-f]+(?:\.[\da-fp-]+)?)\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?[df]?/i,
3192+
operator:{
3193+
pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,
3194+
lookbehind:!0
3195+
},
3196+
function:{
3197+
pattern:/(^|[\s;|&])(?:append|prepend|capitalize|cycle|cols|increment|decrement|abs|at_least|at_most|ceil|compact|concat|date|default|divided_by|downcase|escape|escape_once|first|floor|join|last|lstrip|map|minus|modulo|newline_to_br|plus|remove|remove_first|replace|replace_first|reverse|round|rstrip|size|slice|sort|sort_natural|split|strip|strip_html|strip_newlines|times|truncate|truncatewords|uniq|upcase|url_decode|url_encode|include|paginate)(?=$|[\s;|&])/,
3198+
lookbehind:!0
3199+
}
3200+
};
3201+
31893202
(function (Prism) {
31903203

31913204
Prism.languages.typescript = Prism.languages.extend('javascript', {
@@ -3305,4 +3318,3 @@ Prism.languages.sql = {
33053318
Prism.languages.yml = Prism.languages.yaml;
33063319

33073320
}(Prism));
3308-

lib/docs/filters/liquid/clean_html.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ def call
1414
node.content = node.content.strip
1515
end
1616

17+
css('pre.highlight').each do |node|
18+
node['data-language'] = "liquid"
19+
node['class'] = "language-liquid"
20+
end
21+
1722
doc
1823
end
1924
end

lib/docs/scrapers/liquid.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class Liquid < UrlScraper
33
self.name = 'Liquid'
44
self.type = 'liquid'
55
self.base_url = 'https://shopify.github.io/liquid/'
6-
self.release = '4.0.0'
6+
self.release = '5.0.0'
77
self.links = {
88
home: 'https://shopify.github.io/liquid/',
99
code: 'https://github.com/Shopify/liquid'
@@ -24,5 +24,6 @@ def get_latest_version(opts)
2424
tags = get_github_tags('Shopify', 'liquid', opts)
2525
tags[0]['name'][1..-1]
2626
end
27+
2728
end
2829
end

public/icons/docs/liquid/16.png

672 Bytes
Loading

public/icons/docs/liquid/16@2x.png

775 Bytes
Loading

0 commit comments

Comments
 (0)