Переглянути джерело

Update jq documentation (1.7)

Simon Legner 2 роки тому
батько
коміт
e90bc60b4c

+ 1 - 4
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

+ 1 - 1
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]

+ 4 - 3
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