Pārlūkot izejas kodu

Finish Puppeteer scraper

Thibaut Courouble 7 gadi atpakaļ
vecāks
revīzija
62e07e4e4d

BIN
assets/images/docs-2.png


BIN
assets/images/docs-2@2x.png


+ 3 - 0
assets/javascripts/news.json

@@ -1,5 +1,8 @@
 [
   [
+    "2018-09-23",
+    "New documentation: <a href=\"/puppeteer/\">Puppeteer</a>"
+  ], [
     "2018-08-12",
     "New documentations: <a href=\"/dart/\">Dart</a> and <a href=\"/qt/\">Qt</a>"
   ], [

+ 1 - 0
assets/stylesheets/global/_icons.scss

@@ -178,3 +178,4 @@
 ._icon-bash:before          { background-position: -6rem -3rem; @extend %doc-icon-2; }
 ._icon-dart:before          { background-position: -7rem -3rem; @extend %doc-icon-2; }
 ._icon-qt:before            { background-position: -8rem -3rem; @extend %doc-icon-2; }
+._icon-puppeteer:before     { background-position: -9rem -3rem; @extend %doc-icon-2; }

+ 7 - 5
lib/docs/filters/puppeteer/clean_html.rb

@@ -2,18 +2,20 @@ module Docs
   class Puppeteer
     class CleanHtmlFilter < Filter
       def call
+        at_css('h1').content = 'Puppeteer Documentation'
+
         # None of the elements to remove have classes, so the order of the remove calls is trivial
 
         # Remove links to previous versions of the reference
-        at_css('h5').remove
+        at_css('h1 + ul').remove
 
         # Remove table of contents
-        at_css('h5').remove
-        at_css('ul').remove
+        at_css('h1 + h5').remove
+        at_css('h1 + ul').remove
 
         # Make headers bigger by transforming them into a bigger variant
-        css('h3').each {|node| node.name = 'h2'}
-        css('h4').each {|node| node.name = 'h3'}
+        css('h3').each { |node| node.name = 'h2' }
+        css('h4').each { |node| node.name = 'h3' }
 
         doc
       end

+ 1 - 1
lib/docs/filters/puppeteer/entries.rb

@@ -17,7 +17,7 @@ module Docs
 
               # Prepend events with the class name
               if current_name.start_with?('event: ')
-                current_name = "#{name} event: '#{current_name[/'(.*)'/, 1]}'"
+                current_name = "#{name} event: #{current_name[/'(.*)'/, 1]}"
               end
 
               # Remove arguments from functions

+ 2 - 2
lib/docs/scrapers/puppeteer.rb

@@ -1,7 +1,7 @@
 module Docs
   class Puppeteer < Github
-    self.release = '1.6.2'
-    self.base_url = 'https://github.com/GoogleChrome/puppeteer/blob/v1.6.2/docs/api.md'
+    self.release = '1.8.0'
+    self.base_url = 'https://github.com/GoogleChrome/puppeteer/blob/v1.8.0/docs/api.md'
     self.links = {
       code: 'https://github.com/GoogleChrome/puppeteer'
     }

BIN
public/icons/docs-2.pxm


BIN
public/icons/docs-2@2x.pxm


BIN
public/icons/docs/puppeteer/16.png


BIN
public/icons/docs/puppeteer/16@2x.png