From d774d064ec4b1b30e67e97792d1af26ffa779248 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Wed, 24 Jan 2024 23:10:33 +0100 Subject: [PATCH] Add playwright documentation --- assets/javascripts/news.json | 4 +++ lib/docs/filters/playwright/clean_html.rb | 29 ++++++++++++++++++++++ lib/docs/filters/playwright/entries.rb | 23 +++++++++++++++++ lib/docs/scrapers/playwright.rb | 27 ++++++++++++++++++++ public/icons/docs/playwright/16.png | Bin 0 -> 534 bytes public/icons/docs/playwright/16@2x.png | Bin 0 -> 1132 bytes public/icons/docs/playwright/SOURCE | 1 + 7 files changed, 84 insertions(+) create mode 100644 lib/docs/filters/playwright/clean_html.rb create mode 100644 lib/docs/filters/playwright/entries.rb create mode 100644 lib/docs/scrapers/playwright.rb create mode 100644 public/icons/docs/playwright/16.png create mode 100644 public/icons/docs/playwright/16@2x.png create mode 100644 public/icons/docs/playwright/SOURCE diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index b5340a3c..38dd4bc4 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,4 +1,8 @@ [ + [ + "2024-01-24", + "New documentation: Playwright" + ], [ "2024-01-20", "New documentation: htmx" diff --git a/lib/docs/filters/playwright/clean_html.rb b/lib/docs/filters/playwright/clean_html.rb new file mode 100644 index 00000000..cc97294d --- /dev/null +++ b/lib/docs/filters/playwright/clean_html.rb @@ -0,0 +1,29 @@ +module Docs + class Playwright + class CleanHtmlFilter < Filter + def call + @doc = at_css('.markdown') + + css('x-search').remove + css('hr').remove + css('font:contains("Added in")').remove + css('.list-anchor').remove + + css('.alert').each do |node| + node.name = 'blockquote' + end + + css('pre').each do |node| + node.content = node.css('.token-line').map(&:content).join("\n") + node.remove_attribute('style') + node['data-language'] = node.content =~ /\A\s* + Licensed under the Apache License, Version 2.0. + HTML + + def get_latest_version(opts) + get_npm_version('@playwright/test', opts) + end + end +end diff --git a/public/icons/docs/playwright/16.png b/public/icons/docs/playwright/16.png new file mode 100644 index 0000000000000000000000000000000000000000..a209989def91e7e16b8475203c7b8154597f079d GIT binary patch literal 534 zcmV+x0_pvUP)H^IGd zG1%+QjbP6or$f9J-U#vh*-&5swpC%G%1@<9ns*c?tNhhnZTv#7&t{YE3e&4#1J;@N z!wpy+=sOW)I}A7GS^PzIzVa*$kgf0a))=kO>#^OayTs)Jc4Wv=6)8Mpvi_vM#8Ag|M*Oowdn3f-*MVTC{|ddz z|K<9W{wvMY+@{xJ@2gwsI0b0)OOQ(pHyTP|jmBCZpSZKZ9v4mrx<7Sj)qe*LhsmnQ zf%i*qt%)B|2}#>CFiy4I@Ve@3t=D>Mjo#@kH$AC0$I^qOq^#oU$*1QW=mEkY_TbD+ Y0A{&*WUbG?O#lD@07*qoM6N<$f_Llul>h($ literal 0 HcmV?d00001 diff --git a/public/icons/docs/playwright/16@2x.png b/public/icons/docs/playwright/16@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..e621e1f0c9ad28b15692447214024e7436c15bbe GIT binary patch literal 1132 zcmV-y1e5!TP)iPE5WP6qVgRsJ6 z)sISZw4CYY0ArU>e$_th`yk6n7_=x^mbb#_q4UhxyV*NEnVJHsJa|>0x9PIi2TCm4|Z1{ed_y60WUjHi!Oc6ev zsPa>}U;ByTB(+b-4$xSnOV9y2YYa_L9N^&Kz;Z0u>pm_A+yPpC6-Wov>wzs%nymIh z*E29$&oww-&o$_QYM0(Um;-cH8WM8A50z~y>=Ze=4&yAr{TG z*sS9pI9t~>=(=v47ckKozd|^|q!p_Jw4Fn>E`)f!#uW`G{apU5b*tb_fSQQ--wVtE z#d<4DbaY(<7wDC`96^qMoY`=WzxP304mc6u`d7V272)e%Wef-CtTMugbKNz@5B29* zfE}Q_&iE?ca=_FxEcHf+$9Htg&j)*LHgXTyqA*eQ2h1|{2Gg7B6_)pv`?OxlO;G)< zI9UzDa!kjV(9z_wH-nFbesZ|_1uE8fDYQI;}P^mZ;JIk)YNa1PIOUh>K2@KF4*%Ka!6bW za{qt8*AX)z_5mF-P3@lk8j~d5wWcn>6d$j*%48F&?~M*HG%zrcR2LY!21Kq4^tlKu zqW{1XqM!5sx;*p0=!s8Z3f}mCqrJ*lj;zW^*V|iA$1OOi*2jPL$^h?W&Az^qbiMpP zDNa)VjO+llxmvg^e{Hbd)PSlD5*@doaBUyIPf8OsUc&SLQhiLzR~cV3m}+WDlQyBQ zTaX>FfVrxf>3C0Ng7y>r6(+a!R-1g#TW$POZ=u;4-B$aVy1~IpG;NfIhK4fhx&*uE yxCD0TxdyKVX2ngw9MB2MMZ>#QJnDd9=KugB!#0fqf`pU+0000