Răsfoiți Sursa

Add version support

Remove wierd files
dorimon 6 luni în urmă
părinte
comite
19696fb368

+ 1 - 2
lib/docs/filters/vertx/clean_html.rb

@@ -2,12 +2,11 @@ module Docs
   class Vertx
     class CleanHtmlFilter < Filter
       def call
-        css('hr', 'header', 'nav', '.navbar', '.topbar').remove
+        css('footer', 'hr', 'header', 'nav', '.navbar', '.topbar', '.bg-bg-warning').remove
         xpath('//*[@id="docs-layout"]/div/div[3]').remove
         xpath('//*[@id="docs-layout"]/div/div[1]').remove
         xpath('//main/div[last()]').remove
         xpath('//main/div[1]').remove
-        xpath('//footer').remove
         css('#changelog').remove if root_page?
 
         # Set id attributes on <h3> instead of an empty <a>

+ 0 - 1
lib/docs/filters/vertx/entries.rb

@@ -7,7 +7,6 @@ module Docs
         return nil unless node
 
         result = node.content.strip
-        result = "v5.0.0 - #{result}" if slug.include?('5.0.0')
         result << ' event' if type == 'Events'
         result << '()' if node['class'].to_s.include?('function')
         result

+ 15 - 3
lib/docs/scrapers/vertx.rb

@@ -1,4 +1,3 @@
-
 module Docs
   class Vertx < UrlScraper
     self.type = 'vertx'
@@ -9,17 +8,30 @@ module Docs
 
     html_filters.push 'vertx/entries', 'vertx/clean_html'
 
-    self.base_url = 'https://vertx.io/'
-    self.root_path = 'docs'
     options[:attribution] = <<-HTML
       by Dor Sahar :)
     HTML
 
     options[:skip_patterns] = [
       /api/,
+      /5.0.0/,
       /apidocs/,
       /blog/,
     ]
 
+    version '5.0.0' do
+      self.release = '5.0.0'
+      self.base_url = "https://vertx.io/docs/"
+    end
+
+    version '4.5.15' do
+      self.release = '4.5.15'
+      self.base_url = "https://vertx.io/docs/#{self.version}"
+    end
+
+    version '3.9.16' do
+      self.release = '4.5.15'
+      self.base_url = "https://vertx.io/docs/#{self.version}"
+    end
   end
 end