File tree Expand file tree Collapse file tree
public/icons/docs/playwright Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[
2+ [
3+ " 2024-01-24" ,
4+ " New documentation: <a href=\" /playwright/\" >Playwright</a>"
5+ ],
26 [
37 " 2024-01-20" ,
48 " New documentation: <a href=\" /htmx/\" >htmx</a>"
Original file line number Diff line number Diff line change 1+ module Docs
2+ class Playwright
3+ class CleanHtmlFilter < Filter
4+ def call
5+ @doc = at_css ( '.markdown' )
6+
7+ css ( 'x-search' ) . remove
8+ css ( 'hr' ) . remove
9+ css ( 'font:contains("Added in")' ) . remove
10+ css ( '.list-anchor' ) . remove
11+
12+ css ( '.alert' ) . each do |node |
13+ node . name = 'blockquote'
14+ end
15+
16+ css ( 'pre' ) . each do |node |
17+ node . content = node . css ( '.token-line' ) . map ( &:content ) . join ( "\n " )
18+ node . remove_attribute ( 'style' )
19+ node [ 'data-language' ] = node . content =~ /\A \s *</ ? 'html' : 'javascript'
20+ node . ancestors ( '.theme-code-block' ) . first . replace ( node )
21+ end
22+
23+ css ( '*[class]' ) . remove_attribute ( 'class' )
24+
25+ doc
26+ end
27+ end
28+ end
29+ end
Original file line number Diff line number Diff line change 1+ module Docs
2+ class Playwright
3+ class EntriesFilter < Docs ::EntriesFilter
4+ def get_name
5+ at_css ( 'h1' ) . children . select ( &:text? ) . map ( &:content ) . join . strip
6+ end
7+
8+ def type
9+ type = at_css ( '.menu__link--active' ) . content
10+ return "#{ type } : #{ name } " if slug . starts_with? ( 'api/' )
11+ type
12+ end
13+
14+ def additional_entries
15+ css ( 'x-search' ) . each_with_object [ ] do |node , entries |
16+ prev = node . previous_element
17+ prev = prev . previous_element until prev [ 'id' ]
18+ entries << [ node . text , prev [ 'id' ] ]
19+ end
20+ end
21+ end
22+ end
23+ end
Original file line number Diff line number Diff line change 1+ module Docs
2+ class Playwright < UrlScraper
3+ self . name = 'Playwright'
4+ self . type = 'simple'
5+ self . release = '1.41.1'
6+ self . base_url = 'https://playwright.dev/docs/'
7+ self . root_path = 'intro'
8+ self . links = {
9+ home : 'https://playwright.dev/' ,
10+ code : 'https://github.com/microsoft/playwright'
11+ }
12+
13+ # Docusaurus like react_native
14+ html_filters . push 'playwright/entries' , 'playwright/clean_html'
15+ options [ :download_images ] = false
16+
17+ # https://github.com/microsoft/playwright/blob/main/LICENSE
18+ options [ :attribution ] = <<-HTML
19+ © 2024 Microsoft< br >
20+ Licensed under the Apache License, Version 2.0.
21+ HTML
22+
23+ def get_latest_version ( opts )
24+ get_npm_version ( '@playwright/test' , opts )
25+ end
26+ end
27+ end
Original file line number Diff line number Diff line change 1+ https://playwright.dev/img/playwright-logo.svg
You can’t perform that action at this time.
0 commit comments