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.
34 lines
1.0 KiB
34 lines
1.0 KiB
6 years ago
|
# frozen_string_literal: true
|
||
|
|
||
|
module Docs
|
||
|
class Cypress < UrlScraper
|
||
|
# Follow the instructions on https://github.com/cypress-io/cypress-documentation/blob/develop/CONTRIBUTING.md
|
||
|
# to run the cypress documentation server locally in the following URL:
|
||
|
# self.base_url = 'http://localhost:2222'
|
||
|
self.base_url = 'https://docs.cypress.io'
|
||
|
|
||
|
self.name = 'Cypress'
|
||
|
self.type = 'cypress'
|
||
|
self.root_path = '/api/introduction/api.html'
|
||
|
|
||
|
html_filters.push 'cypress/clean_html', 'cypress/entries'
|
||
|
|
||
|
options[:root_title] = 'Cypress'
|
||
|
options[:container] = '#content'
|
||
|
|
||
|
options[:include_default_entry] = true
|
||
|
|
||
|
options[:skip_link] = lambda do |link|
|
||
|
href = link.attr(:href)
|
||
|
|
||
|
EntriesFilter::SECTIONS.none? { |section| href.match?("/#{section}/") }
|
||
|
end
|
||
|
|
||
|
options[:attribution] = <<-HTML
|
||
|
© 2018 <a href="https://cypress.io">Cypress.io</a>
|
||
|
- Licensed under the
|
||
|
<a href="https://github.com/cypress-io/cypress-documentation/blob/develop/LICENSE.md">MIT License</a>.
|
||
|
HTML
|
||
|
end
|
||
|
end
|