Finish Puppeteer scraper

This commit is contained in:
Thibaut Courouble 2018-09-23 18:09:42 -04:00
parent a6b7bd53c2
commit 62e07e4e4d
11 changed files with 14 additions and 8 deletions

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

View file

@ -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>"
], [

View file

@ -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; }

View file

@ -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

View file

@ -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

View file

@ -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'
}

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 KiB

After

Width:  |  Height:  |  Size: 857 B