Skip to content

Commit d55da94

Browse files
authored
Merge pull request #1550 from Cimbali/jq
2 parents 861ad32 + 727c0c3 commit d55da94

File tree

7 files changed

+62
-0
lines changed

7 files changed

+62
-0
lines changed

assets/javascripts/templates/pages/about_tmpl.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,11 @@ credits = [
416416
'2007-2021 Pallets',
417417
'BSD',
418418
'https://github.com/pallets/jinja/blob/master/LICENSE.rst'
419+
], [
420+
'jq',
421+
'Stephen Dolan',
422+
'CC-BY-3.0',
423+
'https://github.com/stedolan/jq/blob/master/COPYING#L24-L28'
419424
], [
420425
'jQuery',
421426
'Packt Publishing<br>&copy; jQuery Foundation and other contributors',

lib/docs/filters/jq/clean_html.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module Docs
2+
class Jq
3+
class CleanHtmlFilter < Filter
4+
def call
5+
at_css('div#manualcontent')
6+
end
7+
end
8+
end
9+
end

lib/docs/filters/jq/entries.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module Docs
2+
class Jq
3+
class EntriesFilter < Docs::EntriesFilter
4+
def include_default_entry?
5+
false
6+
end
7+
8+
def additional_entries
9+
entries = []
10+
css('#manualcontent > section').each do |node|
11+
type = node.at_css('h2').content
12+
node.css('> section').each do |n|
13+
entries << [n.at_css('h3').content, n['id'], type]
14+
end
15+
end
16+
return entries
17+
end
18+
end
19+
end
20+
end

lib/docs/scrapers/jq.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module Docs
2+
class Jq < UrlScraper
3+
self.name = 'jq'
4+
self.slug = 'jq'
5+
self.type = 'simple'
6+
self.release = '1.6'
7+
self.links = {
8+
home: 'https://stedolan.github.io/jq/'
9+
}
10+
11+
self.base_url = "https://stedolan.github.io/jq/manual/v#{self.release}/index.html"
12+
13+
html_filters.push 'jq/entries', 'jq/clean_html'
14+
15+
options[:skip_links] = true
16+
17+
options[:attribution] = <<-HTML
18+
&copy; 2012 Stephen Dolan<br>
19+
Licensed under the <a href="https://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 license</a>
20+
HTML
21+
22+
def get_latest_version(opts)
23+
get_latest_github_release('stedolan', 'jq', opts).split('-')[1]
24+
end
25+
26+
end
27+
end

public/icons/docs/jq/16.png

801 Bytes
Loading
1.06 KB
Loading

public/icons/docs/jq/SOURCE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://stedolan.github.io/jq/jq.png

0 commit comments

Comments
 (0)