From ed15918157471433a0c4981634a1b15b4e3b9a10 Mon Sep 17 00:00:00 2001 From: Enoc Date: Sat, 30 Jan 2021 11:22:30 -0600 Subject: [PATCH] Update liquid to 5.0 Add prism highlight for liquid --- assets/javascripts/vendor/prism.js | 14 +++++++++++++- lib/docs/filters/liquid/clean_html.rb | 5 +++++ lib/docs/scrapers/liquid.rb | 3 ++- public/icons/docs/liquid/16.png | Bin 458 -> 1130 bytes public/icons/docs/liquid/16@2x.png | Bin 847 -> 1622 bytes 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/vendor/prism.js b/assets/javascripts/vendor/prism.js index 608f999c..f12cee68 100644 --- a/assets/javascripts/vendor/prism.js +++ b/assets/javascripts/vendor/prism.js @@ -3186,6 +3186,19 @@ Prism.languages.sql = { 'punctuation': /[;[\]()`,.]/ }; +Prism.languages.liquid = { + 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/, + number:/\b0b[01]+\b|\b0x(?:\.[\da-fp-]+|[\da-f]+(?:\.[\da-fp-]+)?)\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?[df]?/i, + operator:{ + pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m, + lookbehind:!0 + }, + function:{ + 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;|&])/, + lookbehind:!0 + } +}; + (function (Prism) { Prism.languages.typescript = Prism.languages.extend('javascript', { @@ -3305,4 +3318,3 @@ Prism.languages.sql = { Prism.languages.yml = Prism.languages.yaml; }(Prism)); - diff --git a/lib/docs/filters/liquid/clean_html.rb b/lib/docs/filters/liquid/clean_html.rb index 1a28d112..3cacc29a 100644 --- a/lib/docs/filters/liquid/clean_html.rb +++ b/lib/docs/filters/liquid/clean_html.rb @@ -14,6 +14,11 @@ module Docs node.content = node.content.strip end + css('pre.highlight').each do |node| + node['data-language'] = "liquid" + node['class'] = "language-liquid" + end + doc end end diff --git a/lib/docs/scrapers/liquid.rb b/lib/docs/scrapers/liquid.rb index b8e40d59..e68724b5 100644 --- a/lib/docs/scrapers/liquid.rb +++ b/lib/docs/scrapers/liquid.rb @@ -3,7 +3,7 @@ module Docs self.name = 'Liquid' self.type = 'liquid' self.base_url = 'https://shopify.github.io/liquid/' - self.release = '4.0.0' + self.release = '5.0.0' self.links = { home: 'https://shopify.github.io/liquid/', code: 'https://github.com/Shopify/liquid' @@ -24,5 +24,6 @@ module Docs tags = get_github_tags('Shopify', 'liquid', opts) tags[0]['name'][1..-1] end + end end diff --git a/public/icons/docs/liquid/16.png b/public/icons/docs/liquid/16.png index a3de84adb8521df7f2c12078adf420a10d99b35b..c7049be71e193ab90660b547c359852bd8c66d3a 100644 GIT binary patch literal 1130 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstU$g(vPY0F z14ES>14Ba#1H&(%P{RubhEf9thF1v;3|2E37{m+a>s znjRV!-qG39+SU;f8SU!o-rCmL*wo_f<9qMHlmGw!8=IImx3pDM)zmjMTUpzP2#Z+T z+Nr3hHa53bR@XMSw%61(w6=GOi;H`C`LuU-H?_32w01BtG0mDY&%)BGt)uJNi?>0+ zAsLz3wRMe^RW-#WWmVO+J$(~^sHnKq$Jf8Rw;!krsIsf4PgX{zuAvDim7SZHm7Uw$ zH=(M!Mq5XxyQjaYxivSxATcQgsIs%G2j~T$IlX-oD=MoyyLZ^C4te}Q48p{~)>+YdCVx~8sw;^ZmQW&qh!rp_oWs{lHt zf5K#-dw^jAG!W?i((($R-kx3{qq2YE6relHE2@AV1O};~kPy(c=9c#Q#%7>7Kxc%8 zM|gO80U1DN6c&~AO_eHNE#5vI>p|~ovE-0w3IE}5_S#4g} z92w$O?ZdMl;H`mWx-A9fb``E?AdgM{FkkI5Kk`gMDf`e2WnSwH3O3vJKiHFB1 z@}}h`2gaRu_WWV0RB&$GzJbGKv*`3G(=?eRy`G9rJ*5yH5_j#R4 f-29Zxv`Q=*j3F8%u3rlWYGCkm^>bP0l+XkKa+j+q delta 445 zcmV;u0Yd)j2+9MH7k>)~1^@s6cH#{=0004zNklJ_v%((5iD^<{$ta$htA6+W^^1P!z<@RdK>{8!}s!Ex-6$ z7K#SlCb!glw0#QQ97Cm<$@APIfj&BcFx_78*@bSd5Hr4F@IA|1^)tm|Ae8AU{8w)il3n05TthElb>d%RKzWOm{(r}_J^Q9=;|G} zws<#|6k0!2GkjR4>;{fJ>7H2`|)4($u{a9Mj62^w>kN;sa^PI>nl(Q nu$R)l%jjfkg|Jndz>!k`Ul<0?CbV%x00000NkvXXu0mjf5%AJu diff --git a/public/icons/docs/liquid/16@2x.png b/public/icons/docs/liquid/16@2x.png index d852600d94db2fe7f0fbe3ac4b55909627cbd1fc..ffdaa3b013501566cfb75ae56c9d67b50a6874d6 100644 GIT binary patch delta 1618 zcmV-Y2Ceze2G$Ia7k?lK1^@s6b9#F800004b3#c}2nYxWd$Tw#{MEfZ z-OAS1);p7lXO*T;pW$>d`;sPo*X}|906-AL=5W^W2Pb|y)rug9jkWP$YaN!w#BQNb zY^f5F=l}o!n14*B;T)+rbIu%RW^gd?-Pa00p-}8%V&gV9Hr}gjZhllTvR++P`Kwa- z{HZW0IURx^t72MZ%#V!POrz24q+-#*(d$N|5zm$7WHDJDUj6|A@vjAdL?Th+1o2y1 zTACXg8}Ajp{9ImEdbY1m-76F(rvm_>DF+B$61K*{!GB@4R3gqWo6UsZ0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