Skip to content

Commit 19696fb

Browse files
author
dorimon
committed
Add version support
Remove wierd files
1 parent ade1961 commit 19696fb

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

lib/docs/filters/vertx/clean_html.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ module Docs
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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ def get_name
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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
module Docs
32
class Vertx < UrlScraper
43
self.type = 'vertx'
@@ -9,17 +8,30 @@ class Vertx < UrlScraper
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

0 commit comments

Comments
 (0)