Finish Puppeteer scraper

pull/871/merge
Thibaut Courouble 6 years ago
parent a6b7bd53c2
commit 62e07e4e4d

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 47 KiB

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

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

@ -2,18 +2,20 @@ module Docs
class Puppeteer class Puppeteer
class CleanHtmlFilter < Filter class CleanHtmlFilter < Filter
def call 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 # 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 # Remove links to previous versions of the reference
at_css('h5').remove at_css('h1 + ul').remove
# Remove table of contents # Remove table of contents
at_css('h5').remove at_css('h1 + h5').remove
at_css('ul').remove at_css('h1 + ul').remove
# Make headers bigger by transforming them into a bigger variant # Make headers bigger by transforming them into a bigger variant
css('h3').each {|node| node.name = 'h2'} css('h3').each { |node| node.name = 'h2' }
css('h4').each {|node| node.name = 'h3'} css('h4').each { |node| node.name = 'h3' }
doc doc
end end

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

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 661 B

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 857 B

Loading…
Cancel
Save