mirror of https://github.com/freeCodeCamp/devdocs
parent
41278b82d2
commit
dfee92d4f4
@ -0,0 +1,18 @@
|
||||
._liquid {
|
||||
@extend %simple;
|
||||
|
||||
.code-label {
|
||||
@extend %block-label, %label-green;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
|
||||
.code-label ~ div > pre {
|
||||
margin-top: 0;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
module Docs
|
||||
class Liquid
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
root_page? ? root : other
|
||||
end
|
||||
|
||||
def root
|
||||
doc = at_css('.home-banner')
|
||||
|
||||
css('.btn-row').remove
|
||||
|
||||
doc
|
||||
end
|
||||
|
||||
def other
|
||||
doc = at_css('.content__area > .content')
|
||||
|
||||
css('button.menu-button').remove
|
||||
|
||||
css('code').each do |node|
|
||||
node.remove_attribute('class')
|
||||
node.content = node.content
|
||||
end
|
||||
|
||||
css('pre', '.highlighter-rouge').each do |node|
|
||||
node.remove_attribute('class')
|
||||
end
|
||||
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,28 @@
|
||||
module Docs
|
||||
class Liquid
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
at_css('h1').content
|
||||
end
|
||||
|
||||
def get_type
|
||||
if not root_page?
|
||||
slug.split('/').first.capitalize
|
||||
end
|
||||
end
|
||||
|
||||
def additional_entries
|
||||
entries = []
|
||||
|
||||
if get_type == 'Tags'
|
||||
css('h2').each do |node|
|
||||
entries << [node.content, node['id']]
|
||||
end
|
||||
end
|
||||
|
||||
entries
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,19 @@
|
||||
module Docs
|
||||
class Liquid < UrlScraper
|
||||
self.name = 'Liquid'
|
||||
self.type = 'liquid'
|
||||
self.base_url = "https://shopify.github.io/liquid/"
|
||||
self.links = {
|
||||
home: 'http://liquidmarkup.org/',
|
||||
code: 'https://github.com/shopify/liquid'
|
||||
}
|
||||
|
||||
html_filters.push 'liquid/entries', 'liquid/clean_html'
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2005, 2006 Tobias Luetke<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
|
||||
end
|
||||
end
|
@ -0,0 +1 @@
|
||||
https://shopify.github.io/liquid/images/icons/water-drop-64x.png
|
After Width: | Height: | Size: 3.9 KiB |
Loading…
Reference in new issue