Remove wierd files
Unified · Split
| @@ -2,12 +2,11 @@ module Docs · 1 unmodified line | |||
| 2 | class Vertx | 2 | class Vertx |
| 3 | class CleanHtmlFilter < Filter | 3 | class CleanHtmlFilter < Filter |
| 4 | def call | 4 | def call |
| 5 | css('hr', 'header', 'nav', '.navbar', '.topbar').remove | 5 | css('footer', 'hr', 'header', 'nav', '.navbar', '.topbar', '.bg-bg-warning').remove |
| 6 | xpath('//*[@id="docs-layout"]/div/div[3]').remove | 6 | xpath('//*[@id="docs-layout"]/div/div[3]').remove |
| 7 | xpath('//*[@id="docs-layout"]/div/div[1]').remove | 7 | xpath('//*[@id="docs-layout"]/div/div[1]').remove |
| 8 | xpath('//main/div[last()]').remove | 8 | xpath('//main/div[last()]').remove |
| 9 | xpath('//main/div[1]').remove | 9 | 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> |
| @@ -7,7 +7,6 @@ module Docs · 6 unmodified lines | |||
| 7 | return nil unless node | 7 | return nil unless node |
| 8 | 8 | ||
| 9 | result = node.content.strip | 9 | 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 | result | 12 | result |
| @@ -1,4 +1,3 @@ | |||
| 1 | |||
| 2 | module Docs | 1 | module Docs |
| 3 | class Vertx < UrlScraper | 2 | 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] = <<-HTML | 11 | options[:attribution] = <<-HTML |
| 15 | by Dor Sahar :) | 12 | by Dor Sahar :) |
| 16 | HTML | 13 | 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 | end | 36 | end |
| 25 | end | 37 | end |