Unified · Split
| @@ -57,6 +57,7 @@ · 56 unmodified lines | |||
| 57 | 'pages/knockout', | 57 | 'pages/knockout', |
| 58 | 'pages/kotlin', | 58 | 'pages/kotlin', |
| 59 | 'pages/laravel', | 59 | 'pages/laravel', |
| 60 | 'pages/liquid', | ||
| 60 | 'pages/love', | 61 | 'pages/love', |
| 61 | 'pages/lua', | 62 | 'pages/lua', |
| 62 | 'pages/mdn', | 63 | 'pages/mdn', |
| @@ -57,6 +57,7 @@ · 56 unmodified lines | |||
| 57 | 'pages/knockout', | 57 | 'pages/knockout', |
| 58 | 'pages/kotlin', | 58 | 'pages/kotlin', |
| 59 | 'pages/laravel', | 59 | 'pages/laravel', |
| 60 | 'pages/liquid', | ||
| 60 | 'pages/love', | 61 | 'pages/love', |
| 61 | 'pages/lua', | 62 | 'pages/lua', |
| 62 | 'pages/mdn', | 63 | 'pages/mdn', |
| @@ -0,0 +1,18 @@ | |||
| 1 | ._liquid { | ||
| 2 | @extend %simple; | ||
| 3 | |||
| 4 | .code-label { | ||
| 5 | @extend %block-label, %label-green; | ||
| 6 | border-bottom-left-radius: 0; | ||
| 7 | border-bottom-right-radius: 0; | ||
| 8 | margin-left: 0; | ||
| 9 | margin-right: 0; | ||
| 10 | margin-bottom: -1px; | ||
| 11 | } | ||
| 12 | |||
| 13 | .code-label ~ div > pre { | ||
| 14 | margin-top: 0; | ||
| 15 | border-top-left-radius: 0; | ||
| 16 | border-top-right-radius: 0; | ||
| 17 | } | ||
| 18 | } | ||
| @@ -0,0 +1,34 @@ | |||
| 1 | module Docs | ||
| 2 | class Liquid | ||
| 3 | class CleanHtmlFilter < Filter | ||
| 4 | def call | ||
| 5 | root_page? ? root : other | ||
| 6 | end | ||
| 7 | |||
| 8 | def root | ||
| 9 | doc = at_css('.home-banner') | ||
| 10 | |||
| 11 | css('.btn-row').remove | ||
| 12 | |||
| 13 | doc | ||
| 14 | end | ||
| 15 | |||
| 16 | def other | ||
| 17 | doc = at_css('.content__area > .content') | ||
| 18 | |||
| 19 | css('button.menu-button').remove | ||
| 20 | |||
| 21 | css('code').each do |node| | ||
| 22 | node.remove_attribute('class') | ||
| 23 | node.content = node.content | ||
| 24 | end | ||
| 25 | |||
| 26 | css('pre', '.highlighter-rouge').each do |node| | ||
| 27 | node.remove_attribute('class') | ||
| 28 | end | ||
| 29 | |||
| 30 | doc | ||
| 31 | end | ||
| 32 | end | ||
| 33 | end | ||
| 34 | end | ||
| @@ -0,0 +1,28 @@ | |||
| 1 | module Docs | ||
| 2 | class Liquid | ||
| 3 | class EntriesFilter < Docs::EntriesFilter | ||
| 4 | def get_name | ||
| 5 | at_css('h1').content | ||
| 6 | end | ||
| 7 | |||
| 8 | def get_type | ||
| 9 | if not root_page? | ||
| 10 | slug.split('/').first.capitalize | ||
| 11 | end | ||
| 12 | end | ||
| 13 | |||
| 14 | def additional_entries | ||
| 15 | entries = [] | ||
| 16 | |||
| 17 | if get_type == 'Tags' | ||
| 18 | css('h2').each do |node| | ||
| 19 | entries << [node.content, node['id']] | ||
| 20 | end | ||
| 21 | end | ||
| 22 | |||
| 23 | entries | ||
| 24 | end | ||
| 25 | |||
| 26 | end | ||
| 27 | end | ||
| 28 | end | ||
| @@ -0,0 +1,19 @@ | |||
| 1 | module Docs | ||
| 2 | class Liquid < UrlScraper | ||
| 3 | self.name = 'Liquid' | ||
| 4 | self.type = 'liquid' | ||
| 5 | self.base_url = "https://shopify.github.io/liquid/" | ||
| 6 | self.links = { | ||
| 7 | home: 'http://liquidmarkup.org/', | ||
| 8 | code: 'https://github.com/shopify/liquid' | ||
| 9 | } | ||
| 10 | |||
| 11 | html_filters.push 'liquid/entries', 'liquid/clean_html' | ||
| 12 | |||
| 13 | options[:attribution] = <<-HTML | ||
| 14 | © 2005, 2006 Tobias Luetke<br> | ||
| 15 | Licensed under the MIT License. | ||
| 16 | HTML | ||
| 17 | |||
| 18 | end | ||
| 19 | end | ||
| @@ -0,0 +1 @@ | |||
| 1 | https://shopify.github.io/liquid/images/icons/water-drop-64x.png | ||
Binary file not shown.