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
2 class Vertx2 class Vertx
3 class CleanHtmlFilter < Filter3 class CleanHtmlFilter < Filter
4 def call4 def call
5 css('hr', 'header', 'nav', '.navbar', '.topbar').remove5 css('footer', 'hr', 'header', 'nav', '.navbar', '.topbar', '.bg-bg-warning').remove
6 xpath('//*[@id="docs-layout"]/div/div[3]').remove6 xpath('//*[@id="docs-layout"]/div/div[3]').remove
7 xpath('//*[@id="docs-layout"]/div/div[1]').remove7 xpath('//*[@id="docs-layout"]/div/div[1]').remove
8 xpath('//main/div[last()]').remove8 xpath('//main/div[last()]').remove
9 xpath('//main/div[1]').remove9 xpath('//main/div[1]').remove
10 xpath('//footer').remove
11 css('#changelog').remove if root_page?10 css('#changelog').remove if root_page?
12 11
13 # Set id attributes on <h3> instead of an empty <a>12 # 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
7 return nil unless node7 return nil unless node
8 8
9 result = node.content.strip9 result = node.content.strip
10 result = "v5.0.0 - #{result}" if slug.include?('5.0.0')
11 result << ' event' if type == 'Events'10 result << ' event' if type == 'Events'
12 result << '()' if node['class'].to_s.include?('function')11 result << '()' if node['class'].to_s.include?('function')
13 result12 result
lib/docs/scrapers/vertx.rb+15−3
@@ -1,4 +1,3 @@
1
2module Docs1module Docs
3 class Vertx < UrlScraper2 class Vertx < UrlScraper
4 self.type = 'vertx'3 self.type = 'vertx'
@@ -9,17 +8,30 @@ module Docs · 4 unmodified lines
9 8
10 html_filters.push 'vertx/entries', 'vertx/clean_html'9 html_filters.push 'vertx/entries', 'vertx/clean_html'
11 10
12 self.base_url = 'https://vertx.io/'
13 self.root_path = 'docs'
14 options[:attribution] = <<-HTML11 options[:attribution] = <<-HTML
15 by Dor Sahar :)12 by Dor Sahar :)
16 HTML13 HTML
17 14
18 options[:skip_patterns] = [15 options[:skip_patterns] = [
19 /api/,16 /api/,
17 /5.0.0/,
20 /apidocs/,18 /apidocs/,
21 /blog/,19 /blog/,
22 ]20 ]
23 21
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
24 end36 end
25end37end