History

Update jq documentation (1.7)

Simon Legner committed 3 years ago

Commit e90bc601 parent 7404fae3 files · +6 −8Browse files

Unified · Split

3 files
  1. lib/docs/filters/jq/clean_html.rb +1 −4
  2. lib/docs/filters/jq/entries.rb +1 −1
  3. lib/docs/scrapers/jq.rb +4 −3
lib/docs/filters/jq/clean_html.rb+1−4
@@ -2,8 +2,6 @@ module Docs · 1 unmodified line
2 class Jq2 class Jq
3 class CleanHtmlFilter < Filter3 class CleanHtmlFilter < Filter
4 def call4 def call
5 content = at_css('div#manualcontent')
6
7 css('.manual-example').each do |node|5 css('.manual-example').each do |node|
8 container = node.parent6 container = node.parent
9 example_header = doc.document.create_element('h4')7 example_header = doc.document.create_element('h4')
@@ -13,8 +11,7 @@ module Docs · 3 unmodified lines
13 node.remove_class('collapse')11 node.remove_class('collapse')
14 container.replace(node)12 container.replace(node)
15 end13 end
16 14 doc
17 content
18 end15 end
19 end16 end
20 end17 end
lib/docs/filters/jq/entries.rb+1−1
@@ -7,7 +7,7 @@ module Docs · 6 unmodified lines
7 7
8 def additional_entries8 def additional_entries
9 entries = []9 entries = []
10 css('#manualcontent > section').each do |node|10 css('> section').each do |node|
11 type = node.at_css('h2').content11 type = node.at_css('h2').content
12 node.css('> section').each do |n|12 node.css('> section').each do |n|
13 entries << [n.at_css('h3').content, n['id'], type]13 entries << [n.at_css('h3').content, n['id'], type]
lib/docs/scrapers/jq.rb+4−3
@@ -3,15 +3,16 @@ module Docs · 2 unmodified lines
3 self.name = 'jq'3 self.name = 'jq'
4 self.slug = 'jq'4 self.slug = 'jq'
5 self.type = 'jq'5 self.type = 'jq'
6 self.release = '1.6'6 self.release = '1.7'
7 self.links = {7 self.links = {
8 home: 'https://stedolan.github.io/jq/'8 home: 'https://jqlang.github.io/jq/'
9 }9 }
10 10
11 self.base_url = "https://stedolan.github.io/jq/manual/v#{self.release}/index.html"11 self.base_url = "https://jqlang.github.io/jq/manual/v#{self.release}/index.html"
12 12
13 html_filters.push 'jq/entries', 'jq/clean_html'13 html_filters.push 'jq/entries', 'jq/clean_html'
14 14
15 options[:container] = 'main'
15 options[:skip_links] = true16 options[:skip_links] = true
16 17
17 options[:attribution] = <<-HTML18 options[:attribution] = <<-HTML