mirror of https://github.com/freeCodeCamp/devdocs
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.0 KiB
41 lines
1.0 KiB
# frozen_string_literal: true
|
|
|
|
module Docs
|
|
class Cypress < UrlScraper
|
|
self.name = 'Cypress'
|
|
self.type = 'cypress'
|
|
self.release = '6.8.0'
|
|
self.base_url = 'https://docs.cypress.io'
|
|
self.root_path = '/api/api/table-of-contents.html'
|
|
self.links = {
|
|
home: 'https://www.cypress.io/',
|
|
code: 'https://github.com/cypress-io/cypress',
|
|
}
|
|
|
|
html_filters.push 'cypress/entries', 'cypress/clean_html'
|
|
|
|
options[:container] = '#content'
|
|
options[:max_image_size] = 300_000
|
|
options[:include_default_entry] = true
|
|
|
|
options[:skip_patterns] = [
|
|
/examples\//,
|
|
/guides/
|
|
]
|
|
|
|
options[:skip_link] = ->(link) {
|
|
href = link.attr(:href)
|
|
href.nil? ? true : EntriesFilter::SECTIONS.none? { |section| href.match?("/#{section}/") }
|
|
}
|
|
|
|
options[:attribution] = <<-HTML
|
|
© 2017 Cypress.io<br>
|
|
Licensed under the MIT License.
|
|
HTML
|
|
|
|
def get_latest_version(opts)
|
|
get_latest_github_release('cypress-io', 'cypress', opts)
|
|
end
|
|
end
|
|
end
|