From 4571b01c021a2783fe5ad2b20dde04de70e9162b Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Sun, 18 Mar 2018 11:15:12 -0400 Subject: [PATCH] Update Codeception documentation (2.4.0) --- assets/javascripts/templates/pages/about_tmpl.coffee | 2 +- lib/docs/filters/codeception/clean_html.rb | 6 ++++++ lib/docs/filters/codeception/entries.rb | 2 +- lib/docs/scrapers/codeception.rb | 8 ++++---- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 1b5da039..b62ac372 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -167,7 +167,7 @@ credits = [ 'https://cmake.org/licensing/' ], [ 'Codeception', - '2011-2017 Michael Bodnarchuk and contributors', + '2011 Michael Bodnarchuk and contributors', 'MIT', 'https://raw.githubusercontent.com/Codeception/Codeception/master/LICENSE' ], [ diff --git a/lib/docs/filters/codeception/clean_html.rb b/lib/docs/filters/codeception/clean_html.rb index 218cd78a..6da9b1c2 100644 --- a/lib/docs/filters/codeception/clean_html.rb +++ b/lib/docs/filters/codeception/clean_html.rb @@ -4,6 +4,12 @@ module Docs def call @doc = doc.at_css('#page') + css('.algolia__search-content').remove + + css('.algolia__initial-content').each do |node| + node.before(node.children).remove + end + while doc.element_children.length == 1 doc.first_element_child.before(doc.first_element_child.children).remove end diff --git a/lib/docs/filters/codeception/entries.rb b/lib/docs/filters/codeception/entries.rb index 3419d063..8fdb4c6d 100644 --- a/lib/docs/filters/codeception/entries.rb +++ b/lib/docs/filters/codeception/entries.rb @@ -2,7 +2,7 @@ module Docs class Codeception class EntriesFilter < Docs::EntriesFilter def get_name - name = (at_css('h1') || at_css('h2')).content + name = (at_css('.js-algolia__initial-content h1') || at_css('.js-algolia__initial-content h2')).content if number = subpath[/\A\d+/] name.prepend "#{number.to_i}. " diff --git a/lib/docs/scrapers/codeception.rb b/lib/docs/scrapers/codeception.rb index de409487..c1f12238 100644 --- a/lib/docs/scrapers/codeception.rb +++ b/lib/docs/scrapers/codeception.rb @@ -2,11 +2,11 @@ module Docs class Codeception < UrlScraper self.name = 'Codeception' self.type = 'codeception' - self.release = '2.3.5' - self.base_url = 'http://codeception.com/docs/' + self.release = '2.4.0' + self.base_url = 'https://codeception.com/docs/' self.root_path = 'index.html' self.links = { - home: 'http://codeception.com/', + home: 'https://codeception.com/', code: 'https://github.com/codeception/codeception' } @@ -15,7 +15,7 @@ module Docs options[:skip_patterns] = [/install/] options[:attribution] = <<-HTML - © 2011–2017 Michael Bodnarchuk and contributors
+ © 2011 Michael Bodnarchuk and contributors
Licensed under the MIT License. HTML end