cypress.rb 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. # frozen_string_literal: true
  2. module Docs
  3. class Cypress < UrlScraper
  4. # Follow the instructions on https://github.com/cypress-io/cypress-documentation/blob/develop/CONTRIBUTING.md
  5. # to run the cypress documentation server locally in the following URL:
  6. # self.base_url = 'http://localhost:2222'
  7. self.base_url = 'https://docs.cypress.io'
  8. self.name = 'Cypress'
  9. self.type = 'cypress'
  10. self.root_path = '/api/introduction/api.html'
  11. html_filters.push 'cypress/clean_html', 'cypress/entries'
  12. options[:root_title] = 'Cypress'
  13. options[:container] = '#content'
  14. options[:include_default_entry] = true
  15. options[:skip_link] = lambda do |link|
  16. href = link.attr(:href)
  17. EntriesFilter::SECTIONS.none? { |section| href.match?("/#{section}/") }
  18. end
  19. options[:attribution] = <<-HTML
  20. © 2018 <a href="https://cypress.io">Cypress.io</a>
  21. - Licensed under the
  22. <a href="https://github.com/cypress-io/cypress-documentation/blob/develop/LICENSE.md">MIT License</a>.
  23. HTML
  24. end
  25. end