From d3196c53ed3948d42223053a042ef180f79db2d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Gonz=C3=A1lez?= Date: Tue, 25 Sep 2018 17:51:35 +0200 Subject: [PATCH] Add documentation for cypress.io --- assets/stylesheets/application.css.scss | 1 + assets/stylesheets/pages/_cypress.scss | 21 ++++++++++++ lib/docs/filters/cypress/clean_html.rb | 17 ++++++++++ lib/docs/filters/cypress/entries.rb | 41 ++++++++++++++++++++++++ lib/docs/scrapers/cypress.rb | 33 +++++++++++++++++++ public/icons/docs/cypress/16.png | Bin 0 -> 1183 bytes public/icons/docs/cypress/16@2x.png | Bin 0 -> 1858 bytes public/icons/docs/cypress/SOURCE.ico | Bin 0 -> 32038 bytes 8 files changed, 113 insertions(+) create mode 100644 assets/stylesheets/pages/_cypress.scss create mode 100644 lib/docs/filters/cypress/clean_html.rb create mode 100644 lib/docs/filters/cypress/entries.rb create mode 100644 lib/docs/scrapers/cypress.rb create mode 100644 public/icons/docs/cypress/16.png create mode 100644 public/icons/docs/cypress/16@2x.png create mode 100644 public/icons/docs/cypress/SOURCE.ico diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index fd6ffffd..72feda6a 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -46,6 +46,7 @@ 'pages/coffeescript', 'pages/cordova', 'pages/crystal', + 'pages/cypress', 'pages/d', 'pages/d3', 'pages/dart', diff --git a/assets/stylesheets/pages/_cypress.scss b/assets/stylesheets/pages/_cypress.scss new file mode 100644 index 00000000..aa1108d2 --- /dev/null +++ b/assets/stylesheets/pages/_cypress.scss @@ -0,0 +1,21 @@ +._cypress { + @extend %simple; + + .note { + h1 { + margin-left: inherit + } + + &.danger { + @extend %note-red + } + + &.info { + @extend %note-blue + } + + &.success { + @extend %note-green + } + } +} diff --git a/lib/docs/filters/cypress/clean_html.rb b/lib/docs/filters/cypress/clean_html.rb new file mode 100644 index 00000000..6a36d24c --- /dev/null +++ b/lib/docs/filters/cypress/clean_html.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Docs + class Cypress + class CleanHtmlFilter < Filter + def call + css('.article-edit-link').remove + css('#sidebar').remove + css('article footer').remove + css('#article-toc').remove + css('.article-footer-updated').remove + + doc + end + end + end +end diff --git a/lib/docs/filters/cypress/entries.rb b/lib/docs/filters/cypress/entries.rb new file mode 100644 index 00000000..a854acd7 --- /dev/null +++ b/lib/docs/filters/cypress/entries.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Docs + class Cypress + class EntriesFilter < Docs::EntriesFilter + SECTIONS = %w[ + commands + core-concepts + cypress-api + events + examples + getting-started + guides + overview + plugins + references + utilities + ].freeze + + def get_name + at_css('h1.article-title').content.strip + end + + def get_type + path = context[:url].path + + SECTIONS.each do |section| + if path.match?("/#{section}/") + return section.split('-').map(&:capitalize).join(' ') + end + end + end + + def additional_entries + css('.sidebar-li > a').map do |node| + [node['href']] + end + end + end + end +end diff --git a/lib/docs/scrapers/cypress.rb b/lib/docs/scrapers/cypress.rb new file mode 100644 index 00000000..d6db296a --- /dev/null +++ b/lib/docs/scrapers/cypress.rb @@ -0,0 +1,33 @@ +# 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 Cypress.io + - Licensed under the + MIT License. + HTML + end +end diff --git a/public/icons/docs/cypress/16.png b/public/icons/docs/cypress/16.png new file mode 100644 index 0000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XDXKH0x+qLgU=@qT((;_+{4{z;Yyy&%x#7L z?hDi$)NW4O?0IhYj~crZX`An~2dz9ZYmUjKDW`px+;m%0eLg7n(n}MIxqc^}e-2oE tRmA`Mw9n6V1%Ac%doEP{d-3@n>3hexf5k7BSPCi|JYD@<);T3K0RYQJ$%X&` literal 0 HcmV?d00001 diff --git a/public/icons/docs/cypress/16@2x.png b/public/icons/docs/cypress/16@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..a327f375e2bd8d79903a04704031e94ecf0d93c0 GIT binary patch literal 1858 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL`2bFmY#wM3hAM z`dB6B=jtV<RtPXT0ZVp4u-iLH_n z$Rap^xU(cP4PjGWG1OZ?59)(t^bPe4^xy%qvMP z0$K*u4RauF6;QKm^g+Re6nv1l0gD17$BxTJA0E+mT>P$DlNlITo_e}ChD2~44Ug9N z8YvS0e8)G*=_j5kdu4&^6lH$v$Ild?#kbNn0ZWev$UVT|LX1Ax9iX8 zv?^7wv$Om3?c2BVFayirUre_qb$6fUKYjZ2?7m(6G9A6WzB_jB{yq8quWa{+|C>IC zzL)NG`+VxusrXlRR_q_n=jY`ui@&`iO~7x*u3c%X)Dy4F*ikI=`+urT*#`5R1JlyN ztrGZmT;ElkTc5uAWS;kjBceBg-zo?1Gr2WavZ|}?O^0*Wu3JkdJm>HE{qtv_rzdA> zdU~*j2S;Jeg=^QuzJC86?C;O7s-hAQ7BH6WrkMrG1T-7u+JEf$hPu{;DuVMXf&HDAhv9YpSw{Q0j3k?-5 zEid<$VUS)jXO4{H?K^jt{P|PUTVGdMDVbDKUjDyN)9P_zV&auMcXWC;Ki{%(qod5; zBVI|(8#fxxnmv2*;ls|k&R%|g(+n8=ti3!vCvG`-(2>*l!@0|sjqguY7Ty|be(Ln; zPG;8&1#gxvU20-zs8}E`FR!JgwWzO;uPJ%);>AqtmoGBb*>illRZzh2>-|Jl&RGm$ z66emIow}s4kug)|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