Merge pull request #1550 from Cimbali/jq

pull/1552/head
Simon Legner 4 years ago committed by GitHub
commit d55da94921
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -416,6 +416,11 @@ credits = [
'2007-2021 Pallets', '2007-2021 Pallets',
'BSD', 'BSD',
'https://github.com/pallets/jinja/blob/master/LICENSE.rst' 'https://github.com/pallets/jinja/blob/master/LICENSE.rst'
], [
'jq',
'Stephen Dolan',
'CC-BY-3.0',
'https://github.com/stedolan/jq/blob/master/COPYING#L24-L28'
], [ ], [
'jQuery', 'jQuery',
'Packt Publishing<br>&copy; jQuery Foundation and other contributors', 'Packt Publishing<br>&copy; jQuery Foundation and other contributors',

@ -0,0 +1,9 @@
module Docs
class Jq
class CleanHtmlFilter < Filter
def call
at_css('div#manualcontent')
end
end
end
end

@ -0,0 +1,20 @@
module Docs
class Jq
class EntriesFilter < Docs::EntriesFilter
def include_default_entry?
false
end
def additional_entries
entries = []
css('#manualcontent > section').each do |node|
type = node.at_css('h2').content
node.css('> section').each do |n|
entries << [n.at_css('h3').content, n['id'], type]
end
end
return entries
end
end
end
end

@ -0,0 +1,27 @@
module Docs
class Jq < UrlScraper
self.name = 'jq'
self.slug = 'jq'
self.type = 'simple'
self.release = '1.6'
self.links = {
home: 'https://stedolan.github.io/jq/'
}
self.base_url = "https://stedolan.github.io/jq/manual/v#{self.release}/index.html"
html_filters.push 'jq/entries', 'jq/clean_html'
options[:skip_links] = true
options[:attribution] = <<-HTML
&copy; 2012 Stephen Dolan<br>
Licensed under the <a href="https://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 license</a>
HTML
def get_latest_version(opts)
get_latest_github_release('stedolan', 'jq', opts).split('-')[1]
end
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -0,0 +1 @@
https://stedolan.github.io/jq/jq.png
Loading…
Cancel
Save