History

Add version support

Remove wierd files

dorimon committed 1 year ago

Commit 19696fb1 parent ade19613 files · +16 −6Browse files

Unified · Split

3 files
  1. lib/docs/filters/vertx/clean_html.rb +1 −2
  2. lib/docs/filters/vertx/entries.rb +0 −1
  3. lib/docs/scrapers/vertx.rb +15 −3
lib/docs/filters/vertx/clean_html.rb+1−2
@@ -2,12 +2,11 @@ module Docs · 1 unmodified line
22 class Vertx
33 class CleanHtmlFilter < Filter
44 def call
5− css('hr', 'header', 'nav', '.navbar', '.topbar').remove
5+ css('footer', 'hr', 'header', 'nav', '.navbar', '.topbar', '.bg-bg-warning').remove
66 xpath('//*[@id="docs-layout"]/div/div[3]').remove
77 xpath('//*[@id="docs-layout"]/div/div[1]').remove
88 xpath('//main/div[last()]').remove
99 xpath('//main/div[1]').remove
10− xpath('//footer').remove
1110 css('#changelog').remove if root_page?
1211
1312 # Set id attributes on <h3> instead of an empty <a>
lib/docs/filters/vertx/entries.rb+0−1
@@ -7,7 +7,6 @@ module Docs · 6 unmodified lines
77 return nil unless node
88
99 result = node.content.strip
10− result = "v5.0.0 - #{result}" if slug.include?('5.0.0')
1110 result << ' event' if type == 'Events'
1211 result << '()' if node['class'].to_s.include?('function')
1312 result
lib/docs/scrapers/vertx.rb+15−3
@@ -1,4 +1,3 @@
1−
21 module Docs
32 class Vertx < UrlScraper
43 self.type = 'vertx'
@@ -9,17 +8,30 @@ module Docs · 4 unmodified lines
98
109 html_filters.push 'vertx/entries', 'vertx/clean_html'
1110
12− self.base_url = 'https://vertx.io/'
13− self.root_path = 'docs'
1411 options[:attribution] = <<-HTML
1512 by Dor Sahar :)
1613 HTML
1714
1815 options[:skip_patterns] = [
1916 /api/,
17+ /5.0.0/,
2018 /apidocs/,
2119 /blog/,
2220 ]
2321
22+ version '5.0.0' do
23+ self.release = '5.0.0'
24+ self.base_url = "https://vertx.io/docs/"
25+ end
26+
27+ version '4.5.15' do
28+ self.release = '4.5.15'
29+ self.base_url = "https://vertx.io/docs/#{self.version}"
30+ end
31+
32+ version '3.9.16' do
33+ self.release = '4.5.15'
34+ self.base_url = "https://vertx.io/docs/#{self.version}"
35+ end
2436 end
2537 end