File tree Expand file tree Collapse file tree
javascripts/templates/pages
public/icons/docs/cypress Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -202,6 +202,12 @@ credits = [
202202 ' Apache' ,
203203 ' https://raw.githubusercontent.com/crystal-lang/crystal/master/LICENSE'
204204 ], [
205+ ' Cypress' ,
206+ ' 2017 Cypress.io' ,
207+ ' MIT' ,
208+ ' https://raw.githubusercontent.com/cypress-io/cypress-documentation/develop/LICENSE.md'
209+ ],
210+ [
205211 ' D' ,
206212 ' 1999-2018 The D Language Foundation' ,
207213 ' Boost' ,
Original file line number Diff line number Diff line change 4545 ' pages/coffeescript' ,
4646 ' pages/cordova' ,
4747 ' pages/crystal' ,
48+ ' pages/cypress' ,
4849 ' pages/d' ,
4950 ' pages/d3' ,
5051 ' pages/dart' ,
Original file line number Diff line number Diff line change 1+ ._cypress {
2+ @extend %simple ;
3+
4+ .note {
5+ h1 {
6+ margin-left : inherit
7+ }
8+
9+ & .danger {
10+ @extend %note-red
11+ }
12+
13+ & .info {
14+ @extend %note-blue
15+ }
16+
17+ & .success {
18+ @extend %note-green
19+ }
20+ }
21+ }
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ module Docs
4+ class Cypress
5+ class CleanHtmlFilter < Filter
6+ def call
7+ article_div = at_css ( '#article > div' )
8+ @doc = article_div unless article_div . nil?
9+
10+ header = at_css ( 'h1.article-title' )
11+ doc . prepend_child ( header ) unless header . nil?
12+
13+ css ( '.article-edit-link' ) . remove
14+ css ( '.article-footer' ) . remove
15+ css ( '.article-footer-updated' ) . remove
16+
17+ css ( 'pre' ) . each do |node |
18+ node . content = node . content
19+ node [ 'data-language' ] = 'javascript'
20+ end
21+
22+ doc
23+ end
24+ end
25+ end
26+ end
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ module Docs
4+ class Cypress
5+ class EntriesFilter < Docs ::EntriesFilter
6+ SECTIONS = %w[
7+ commands
8+ core-concepts
9+ cypress-api
10+ events
11+ getting-started
12+ guides
13+ overview
14+ plugins
15+ references
16+ utilities
17+ ] . freeze
18+
19+ def get_name
20+ at_css ( 'h1.article-title' ) . content . strip
21+ end
22+
23+ def get_type
24+ path = context [ :url ] . path
25+
26+ SECTIONS . each do |section |
27+ if path . match? ( "/#{ section } /" )
28+ return section . split ( '-' ) . map ( &:capitalize ) . join ( ' ' )
29+ end
30+ end
31+ end
32+ end
33+ end
34+ end
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ module Docs
4+ class Cypress < UrlScraper
5+ self . name = 'Cypress'
6+ self . type = 'cypress'
7+ self . release = '3.4.1'
8+ self . base_url = 'https://docs.cypress.io'
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+ }
14+
15+ html_filters . push 'cypress/entries' , 'cypress/clean_html'
16+
17+ options [ :container ] = '#content'
18+ options [ :max_image_size ] = 300_000
19+ options [ :include_default_entry ] = true
20+
21+ options [ :skip_patterns ] = [ /examples\/ / ]
22+ options [ :skip_link ] = -> ( link ) {
23+ href = link . attr ( :href )
24+ href . nil? ? true : EntriesFilter ::SECTIONS . none? { |section | href . match? ( "/#{ section } /" ) }
25+ }
26+
27+ options [ :attribution ] = <<-HTML
28+ © 2017 Cypress.io< br >
29+ Licensed under the MIT License.
30+ HTML
31+
32+ def get_latest_version ( opts )
33+ get_latest_github_release ( 'cypress-io' , 'cypress' , opts )
34+ end
35+ end
36+ end
You can’t perform that action at this time.
0 commit comments