Unified · Split
| @@ -4,17 +4,13 @@ module Docs · 3 unmodified lines | |||
| 4 | class Cypress | 4 | class Cypress |
| 5 | class CleanHtmlFilter < Filter | 5 | class CleanHtmlFilter < Filter |
| 6 | def call | 6 | def call |
| 7 | article_div = at_css('#article > div') | ||
| 8 | @doc = article_div unless article_div.nil? | ||
| 9 | 7 | ||
| 10 | header = at_css('h1.article-title') | 8 | css('div[role=alert]').each do |node| |
| 11 | doc.prepend_child(header) unless header.nil? | 9 | node.name = 'blockquote' |
| 12 | 10 | node.add_class('note info') | |
| 13 | css('.article-edit-link').remove | 11 | end |
| 14 | css('.article-footer').remove | ||
| 15 | css('.article-footer-updated').remove | ||
| 16 | 12 | ||
| 17 | css('.dashboard-ad').remove | 13 | css('footer').remove |
| 18 | 14 | ||
| 19 | css('pre').each do |node| | 15 | css('pre').each do |node| |
| 20 | node.content = node.content | 16 | node.content = node.content |
| @@ -17,7 +17,7 @@ module Docs · 16 unmodified lines | |||
| 17 | ].freeze | 17 | ].freeze |
| 18 | 18 | ||
| 19 | def get_name | 19 | def get_name |
| 20 | at_css('h1.article-title').content.strip | 20 | at_css('h1.main-content-title').content.strip |
| 21 | end | 21 | end |
| 22 | 22 | ||
| 23 | def get_type | 23 | def get_type |
| @@ -4,9 +4,9 @@ module Docs · 3 unmodified lines | |||
| 4 | class Cypress < UrlScraper | 4 | class Cypress < UrlScraper |
| 5 | self.name = 'Cypress' | 5 | self.name = 'Cypress' |
| 6 | self.type = 'cypress' | 6 | self.type = 'cypress' |
| 7 | self.release = '6.8.0' | 7 | self.release = '7.2.0' |
| 8 | self.base_url = 'https://docs.cypress.io' | 8 | self.base_url = 'https://docs.cypress.io' |
| 9 | self.root_path = '/api/api/table-of-contents.html' | 9 | self.root_path = '/api/table-of-contents.html' |
| 10 | self.links = { | 10 | self.links = { |
| 11 | home: 'https://www.cypress.io/', | 11 | home: 'https://www.cypress.io/', |
| 12 | code: 'https://github.com/cypress-io/cypress', | 12 | code: 'https://github.com/cypress-io/cypress', |
| @@ -14,7 +14,7 @@ module Docs · 1 unmodified line | |||
| 14 | 14 | ||
| 15 | html_filters.push 'cypress/entries', 'cypress/clean_html' | 15 | html_filters.push 'cypress/entries', 'cypress/clean_html' |
| 16 | 16 | ||
| 17 | options[:container] = '#content' | 17 | options[:container] = 'article' |
| 18 | options[:max_image_size] = 300_000 | 18 | options[:max_image_size] = 300_000 |
| 19 | options[:include_default_entry] = true | 19 | options[:include_default_entry] = true |
| 20 | 20 | ||