| @@ -2,32 +2,35 @@ · 1 unmodified line |
| 2 | 2 | |
| 3 | 3 | module Docs |
| 4 | 4 | class Cypress < UrlScraper |
| 5 | | − # Follow the instructions on https://github.com/cypress-io/cypress-documentation/blob/develop/CONTRIBUTING.md |
| 6 | | − # to run the cypress documentation server locally in the following URL: |
| 7 | | − # self.base_url = 'http://localhost:2222' |
| 8 | | − self.base_url = 'https://docs.cypress.io' |
| 9 | | − |
| 10 | 5 | self.name = 'Cypress' |
| 11 | 6 | self.type = 'cypress' |
| 7 | + self.release = '3.4.1' |
| 8 | + self.base_url = 'https://docs.cypress.io' |
| 12 | 9 | self.root_path = '/api/api/table-of-contents.html' |
| 10 | + self.links = { |
| 11 | + home: 'https://www.cypress.io/', |
| 12 | + code: 'https://github.com/cypress-io/cypress', |
| 13 | + } |
| 13 | 14 | |
| 14 | | − html_filters.push 'cypress/clean_html', 'cypress/entries' |
| 15 | + html_filters.push 'cypress/entries', 'cypress/clean_html' |
| 15 | 16 | |
| 16 | | − options[:root_title] = 'Cypress' |
| 17 | 17 | options[:container] = '#content' |
| 18 | | − |
| 18 | + options[:max_image_size] = 300_000 |
| 19 | 19 | options[:include_default_entry] = true |
| 20 | 20 | |
| 21 | | − options[:skip_link] = lambda do |link| |
| 21 | + options[:skip_patterns] = [/examples\//] |
| 22 | + options[:skip_link] = ->(link) { |
| 22 | 23 | href = link.attr(:href) |
| 23 | | − |
| 24 | | − EntriesFilter::SECTIONS.none? { |section| href.match?("/#{section}/") } |
| 25 | | − end |
| 24 | + href.nil? ? true : EntriesFilter::SECTIONS.none? { |section| href.match?("/#{section}/") } |
| 25 | + } |
| 26 | 26 | |
| 27 | 27 | options[:attribution] = <<-HTML |
| 28 | | − © 2018 <a href="https://cypress.io">Cypress.io</a> |
| 29 | | − - Licensed under the |
| 30 | | − <a href="https://github.com/cypress-io/cypress-documentation/blob/develop/LICENSE.md">MIT License</a>. |
| 28 | + © 2017 Cypress.io<br> |
| 29 | + Licensed under the MIT License. |
| 31 | 30 | HTML |
| 31 | + |
| 32 | + def get_latest_version(opts) |
| 33 | + get_latest_github_release('cypress-io', 'cypress', opts) |
| 34 | + end |
| 32 | 35 | end |
| 33 | 36 | end |