From e90bc60b4c78114ed528cbeda93f181f00e5788e Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Mon, 9 Oct 2023 21:24:34 +0200 Subject: [PATCH] Update jq documentation (1.7) --- lib/docs/filters/jq/clean_html.rb | 5 +---- lib/docs/filters/jq/entries.rb | 2 +- lib/docs/scrapers/jq.rb | 7 ++++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/docs/filters/jq/clean_html.rb b/lib/docs/filters/jq/clean_html.rb index 036ee866..9217b0a2 100644 --- a/lib/docs/filters/jq/clean_html.rb +++ b/lib/docs/filters/jq/clean_html.rb @@ -2,8 +2,6 @@ module Docs class Jq class CleanHtmlFilter < Filter def call - content = at_css('div#manualcontent') - css('.manual-example').each do |node| container = node.parent example_header = doc.document.create_element('h4') @@ -13,8 +11,7 @@ module Docs node.remove_class('collapse') container.replace(node) end - - content + doc end end end diff --git a/lib/docs/filters/jq/entries.rb b/lib/docs/filters/jq/entries.rb index 0f6e1ceb..79d87b09 100644 --- a/lib/docs/filters/jq/entries.rb +++ b/lib/docs/filters/jq/entries.rb @@ -7,7 +7,7 @@ module Docs def additional_entries entries = [] - css('#manualcontent > section').each do |node| + css('> 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] diff --git a/lib/docs/scrapers/jq.rb b/lib/docs/scrapers/jq.rb index 5125b863..38e29ffe 100644 --- a/lib/docs/scrapers/jq.rb +++ b/lib/docs/scrapers/jq.rb @@ -3,15 +3,16 @@ module Docs self.name = 'jq' self.slug = 'jq' self.type = 'jq' - self.release = '1.6' + self.release = '1.7' self.links = { - home: 'https://stedolan.github.io/jq/' + home: 'https://jqlang.github.io/jq/' } - self.base_url = "https://stedolan.github.io/jq/manual/v#{self.release}/index.html" + self.base_url = "https://jqlang.github.io/jq/manual/v#{self.release}/index.html" html_filters.push 'jq/entries', 'jq/clean_html' + options[:container] = 'main' options[:skip_links] = true options[:attribution] = <<-HTML