History

Finish Puppeteer scraper

Thibaut Courouble committed 8 years ago

Commit 62e07e41 parent a6b7bd511 files · +8 −2Browse files

Unified · Split

11 files
  1. assets/images/docs-2.png +0 −0
  2. assets/images/docs-2@2x.png +0 −0
  3. assets/javascripts/news.json +3 −0
  4. assets/stylesheets/global/_icons.scss +1 −0
  5. lib/docs/filters/puppeteer/clean_html.rb +7 −5
  6. lib/docs/filters/puppeteer/entries.rb +1 −1
  7. lib/docs/scrapers/puppeteer.rb +2 −2
  8. public/icons/docs-2.pxm +0 −0
  9. public/icons/docs-2@2x.pxm +0 −0
  10. public/icons/docs/puppeteer/16.png +0 −0
  11. public/icons/docs/puppeteer/16@2x.png +0 −0
assets/images/docs-2.png+0−0

Binary file not shown.

assets/images/docs-2@2x.png+0−0

Binary file not shown.

assets/javascripts/news.json+3−0
@@ -1,5 +1,8 @@
1[1[
2 [2 [
3 "2018-09-23",
4 "New documentation: <a href=\"/puppeteer/\">Puppeteer</a>"
5 ], [
3 "2018-08-12",6 "2018-08-12",
4 "New documentations: <a href=\"/dart/\">Dart</a> and <a href=\"/qt/\">Qt</a>"7 "New documentations: <a href=\"/dart/\">Dart</a> and <a href=\"/qt/\">Qt</a>"
5 ], [8 ], [
assets/stylesheets/global/_icons.scss+1−0
@@ -178,3 +178,4 @@ · 177 unmodified lines
178._icon-bash:before { background-position: -6rem -3rem; @extend %doc-icon-2; }178._icon-bash:before { background-position: -6rem -3rem; @extend %doc-icon-2; }
179._icon-dart:before { background-position: -7rem -3rem; @extend %doc-icon-2; }179._icon-dart:before { background-position: -7rem -3rem; @extend %doc-icon-2; }
180._icon-qt:before { background-position: -8rem -3rem; @extend %doc-icon-2; }180._icon-qt:before { background-position: -8rem -3rem; @extend %doc-icon-2; }
181._icon-puppeteer:before { background-position: -9rem -3rem; @extend %doc-icon-2; }
lib/docs/filters/puppeteer/clean_html.rb+7−5
@@ -2,18 +2,20 @@ module Docs · 1 unmodified line
2 class Puppeteer2 class Puppeteer
3 class CleanHtmlFilter < Filter3 class CleanHtmlFilter < Filter
4 def call4 def call
5 at_css('h1').content = 'Puppeteer Documentation'
6
5 # None of the elements to remove have classes, so the order of the remove calls is trivial7 # None of the elements to remove have classes, so the order of the remove calls is trivial
6 8
7 # Remove links to previous versions of the reference9 # Remove links to previous versions of the reference
8 at_css('h5').remove10 at_css('h1 + ul').remove
9 11
10 # Remove table of contents12 # Remove table of contents
11 at_css('h5').remove13 at_css('h1 + h5').remove
12 at_css('ul').remove14 at_css('h1 + ul').remove
13 15
14 # Make headers bigger by transforming them into a bigger variant16 # Make headers bigger by transforming them into a bigger variant
15 css('h3').each {|node| node.name = 'h2'}17 css('h3').each { |node| node.name = 'h2' }
16 css('h4').each {|node| node.name = 'h3'}18 css('h4').each { |node| node.name = 'h3' }
17 19
18 doc20 doc
19 end21 end
lib/docs/filters/puppeteer/entries.rb+1−1
@@ -17,7 +17,7 @@ module Docs · 16 unmodified lines
17 17
18 # Prepend events with the class name18 # Prepend events with the class name
19 if current_name.start_with?('event: ')19 if current_name.start_with?('event: ')
20 current_name = "#{name} event: '#{current_name[/'(.*)'/, 1]}'"20 current_name = "#{name} event: #{current_name[/'(.*)'/, 1]}"
21 end21 end
22 22
23 # Remove arguments from functions23 # Remove arguments from functions
lib/docs/scrapers/puppeteer.rb+2−2
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Puppeteer < Github2 class Puppeteer < Github
3 self.release = '1.6.2'3 self.release = '1.8.0'
4 self.base_url = 'https://github.com/GoogleChrome/puppeteer/blob/v1.6.2/docs/api.md'4 self.base_url = 'https://github.com/GoogleChrome/puppeteer/blob/v1.8.0/docs/api.md'
5 self.links = {5 self.links = {
6 code: 'https://github.com/GoogleChrome/puppeteer'6 code: 'https://github.com/GoogleChrome/puppeteer'
7 }7 }
public/icons/docs-2.pxm+0−0

Binary file not shown.

public/icons/docs-2@2x.pxm+0−0

Binary file not shown.

public/icons/docs/puppeteer/16.png+0−0

Binary file not shown.

public/icons/docs/puppeteer/16@2x.png+0−0

Binary file not shown.