File tree Expand file tree Collapse file tree
assets/javascripts/templates/pages
public/icons/docs/puppeteer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -560,6 +560,11 @@ credits = [
560560 ' 1996-2018 The PostgreSQL Global Development Group<br>© 1994 The Regents of the University of California' ,
561561 ' PostgreSQL' ,
562562 ' https://www.postgresql.org/about/licence/'
563+ ], [
564+ ' Puppeteer' ,
565+ ' 2017 Google Inc' ,
566+ ' Apache' ,
567+ ' https://raw.githubusercontent.com/GoogleChrome/puppeteer/master/LICENSE'
563568 ], [
564569 ' Pygame' ,
565570 ' Pygame Developpers' ,
Original file line number Diff line number Diff line change 1+ module Docs
2+ class Puppeteer
3+ class CleanHtmlFilter < Filter
4+ def call
5+ # None of the elements to remove have classes, so the order of the remove calls is trivial
6+
7+ # Remove links to previous versions of the reference
8+ at_css ( 'h5' ) . remove
9+
10+ # Remove table of contents
11+ at_css ( 'h5' ) . remove
12+ at_css ( 'ul' ) . remove
13+
14+ # Make headers bigger by transforming them into a bigger variant
15+ css ( 'h3' ) . each { |node | node . name = 'h2' }
16+ css ( 'h4' ) . each { |node | node . name = 'h3' }
17+
18+ doc
19+ end
20+ end
21+ end
22+ end
Original file line number Diff line number Diff line change 1+ module Docs
2+ class Puppeteer
3+ class EntriesFilter < Docs ::EntriesFilter
4+ # The entire reference is one big page, so get_name and get_type are not necessary
5+
6+ def additional_entries
7+ entries = [ ]
8+
9+ css ( 'h3' ) . each do |node |
10+ name = node . content . split ( ': ' ) . last
11+
12+ # Find all sub-items (all h4's between the current h3 and the next)
13+ current = node . next
14+ while !current . nil? && current . name != 'h3'
15+ if current . name == 'h4'
16+ current_name = current . content
17+
18+ # Prepend events with the class name
19+ if current_name . start_with? ( 'event: ' )
20+ current_name = "#{ name } event: '#{ current_name [ /'(.*)'/ , 1 ] } '"
21+ end
22+
23+ # Remove arguments from functions
24+ if current_name . include? ( '(' )
25+ current_name = current_name . split ( '(' ) [ 0 ] + '()'
26+ end
27+
28+ entries << [ current_name , current [ 'id' ] , name ]
29+ end
30+
31+ current = current . next
32+ end
33+
34+ entries << [ name , node [ 'id' ] , name ]
35+ end
36+
37+ entries
38+ end
39+ end
40+ end
41+ end
Original file line number Diff line number Diff line change 1+ module Docs
2+ class Puppeteer < Github
3+ self . release = '1.6.2'
4+ self . base_url = 'https://github.com/GoogleChrome/puppeteer/blob/v1.6.2/docs/api.md'
5+ self . links = {
6+ code : 'https://github.com/GoogleChrome/puppeteer'
7+ }
8+
9+ html_filters . push 'puppeteer/entries' , 'puppeteer/clean_html'
10+
11+ options [ :container ] = '.markdown-body'
12+
13+ options [ :attribution ] = <<-HTML
14+ © 2017 Google Inc< br >
15+ Licensed under the Apache License 2.0.
16+ HTML
17+ end
18+ end
Original file line number Diff line number Diff line change 1+ https://github.com/GoogleChromeLabs/pptr.dev/tree/master/src/favicons
You can’t perform that action at this time.
0 commit comments