Ver código fonte

Update Codeception documentation (2.4.0)

Thibaut Courouble 7 anos atrás
pai
commit
4571b01c02

+ 1 - 1
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'
   ], [

+ 6 - 0
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

+ 1 - 1
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}. "

+ 4 - 4
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
-      &copy; 2011&ndash;2017 Michael Bodnarchuk and contributors<br>
+      &copy; 2011 Michael Bodnarchuk and contributors<br>
       Licensed under the MIT License.
     HTML
   end