From 9d9e8e47b90755524b675d09a8fc3dd787c0de33 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Fri, 4 Nov 2022 23:12:44 +0100 Subject: [PATCH] Add VueUse documentation (9.4.0) https://vueuse.org/ --- assets/javascripts/news.json | 4 +++ .../templates/pages/about_tmpl.coffee | 5 +++ lib/docs/filters/vite/clean_html.rb | 1 + lib/docs/filters/vueuse/clean_html.rb | 28 +++++++++++++++ lib/docs/filters/vueuse/entries.rb | 18 ++++++++++ lib/docs/scrapers/vueuse.rb | 32 ++++++++++++++++++ public/icons/docs/vueuse/16.png | Bin 0 -> 893 bytes public/icons/docs/vueuse/16@2x.png | Bin 0 -> 970 bytes public/icons/docs/vueuse/SOURCE | 2 ++ public/icons/docs/vueuse/favicon-16x16.png | Bin 0 -> 702 bytes 10 files changed, 90 insertions(+) create mode 100644 lib/docs/filters/vueuse/clean_html.rb create mode 100644 lib/docs/filters/vueuse/entries.rb create mode 100644 lib/docs/scrapers/vueuse.rb create mode 100644 public/icons/docs/vueuse/16.png create mode 100644 public/icons/docs/vueuse/16@2x.png create mode 100644 public/icons/docs/vueuse/SOURCE create mode 100644 public/icons/docs/vueuse/favicon-16x16.png diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index 1dbc759f..df52090b 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,4 +1,8 @@ [ + [ + "2022-11-04", + "New documentation: VueUse" + ], [ "2022-10-10", "New documentation: Astro" diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 5d883ab0..7ca88895 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -955,6 +955,11 @@ credits = [ '2013-present Yuxi Evan You', 'MIT', 'https://raw.githubusercontent.com/vuejs/vuejs.org/master/LICENSE' + ], [ + 'Vueuse', + '2019-present Anthony Fu', + 'MIT', + 'https://raw.githubusercontent.com/vueuse/vueuse/main/LICENSE' ], [ 'Vuex', '2015-present Evan You', diff --git a/lib/docs/filters/vite/clean_html.rb b/lib/docs/filters/vite/clean_html.rb index 76917658..39583b91 100644 --- a/lib/docs/filters/vite/clean_html.rb +++ b/lib/docs/filters/vite/clean_html.rb @@ -3,6 +3,7 @@ module Docs class CleanHtmlFilter < Filter def call return "

Vitest

A Vite-native unit test framework. It's fast!

" if root_page? && current_url.host == 'vitest.dev' + return "

VueUse

Collection of Vue Composition Utilities

" if root_page? && current_url.host == 'vueuse.org' return '

Vite

' if root_page? @doc = at_css('main h1').parent diff --git a/lib/docs/filters/vueuse/clean_html.rb b/lib/docs/filters/vueuse/clean_html.rb new file mode 100644 index 00000000..9e8788f4 --- /dev/null +++ b/lib/docs/filters/vueuse/clean_html.rb @@ -0,0 +1,28 @@ +module Docs + class Vueuse + class CleanHtmlFilter < Filter + def call + css('#demo, #contributors ~ div, #contributors, #changelog ~ div, #changelog').remove + + css('.grid').each do |table| + table.name = 'table' + tr = nil + table.children.each do |td| + if td['opacity'] + table.add_child('') + tr = table.last_element_child + td.name = 'th' + td.remove_attribute('opacity') + tr.add_child(td.remove) + else + td.name = 'td' + tr.add_child(td.remove) + end + end + end + + doc + end + end + end +end diff --git a/lib/docs/filters/vueuse/entries.rb b/lib/docs/filters/vueuse/entries.rb new file mode 100644 index 00000000..289c9c3d --- /dev/null +++ b/lib/docs/filters/vueuse/entries.rb @@ -0,0 +1,18 @@ +module Docs + class Vueuse + class EntriesFilter < Docs::EntriesFilter + def get_name + name = at_css('h1').content + name.sub! %r{\s*#\s*}, '' + name + end + + def get_type + return 'Guide' if slug == 'export-size' + return 'Guide' if slug == 'functions' + link = at_css('aside .link.active') + link.ancestors('section').at_css('.title').content + end + end + end +end diff --git a/lib/docs/scrapers/vueuse.rb b/lib/docs/scrapers/vueuse.rb new file mode 100644 index 00000000..2ce00d8e --- /dev/null +++ b/lib/docs/scrapers/vueuse.rb @@ -0,0 +1,32 @@ +module Docs + class Vueuse < UrlScraper + self.name = 'VueUse' + self.slug = 'vueuse' + self.type = 'vueuse' + self.links = { + home: 'https://vueuse.org/', + code: 'https://github.com/vueuse/vueuse' + } + + options[:skip] = %w(add-ons contributing ecosystem) + options[:skip_patterns] = [/index$/] + options[:fix_urls] = ->(url) do + url.sub! 'vueuse.org/use', 'vueuse.org/core/use' + url + end + + options[:attribution] = <<-HTML + © 2019-present Anthony Fu
+ Licensed under the MIT License. + HTML + + self.release = '9.4.0' + self.base_url = 'https://vueuse.org/' + self.initial_paths = %w(functions.html) + html_filters.push 'vueuse/entries', 'vite/clean_html', 'vueuse/clean_html' + + def get_latest_version(opts) + get_npm_version('vueuse', opts) + end + end +end diff --git a/public/icons/docs/vueuse/16.png b/public/icons/docs/vueuse/16.png new file mode 100644 index 0000000000000000000000000000000000000000..fd44a6bb81f1521ca4d996e25d1b4df9fcf0c804 GIT binary patch literal 893 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDnogBxn5>o zc5!lIL8@MUQTpt6Hc~)EEa{HEjtmSN`?>!lvI6-E$sR$z3=CCj3=9n|3=F@3LJcn% z7)lKo7+xhXFj&oCU=S~uvn$XBD8XLh>Fdh=jEhsqOslL!Yb8*Kv%n*=80ZdZ5M~VA zC2)g*fiWz=C&U#f`RBOy|NRa{Go@M=$Shl}STtL@Zl3htKwX!2eOmFa zFstWXM#3U{{(fp^WEEyA`uD(?QI%gY&zw;+VcE~vyCLk}m5i>x7jwK_D#m6NdRc9m zFk8@xTq~crcU)6H=QG7G7v`P*DN*EG&rB9p&fBt}C}&Lac6TXU&mQv#$hqL@;us=v zIXQuW*-aq9fvKm*Xj6|yjb$aPTZ-M{MU#x2#D$d?cV#us+Qk;pFmvY2*1+J^3ml@| z!~3W9_B!4_Fk$ZD6FU|xIB;aj4`+>26M`!2L fr`?^N%{LfUA5*^fws2=UC}cfd{an^LB{Ts5>>q1; literal 0 HcmV?d00001 diff --git a/public/icons/docs/vueuse/16@2x.png b/public/icons/docs/vueuse/16@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..2ab84424ba674712c528de0913f674b395ff3e2f GIT binary patch literal 970 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dy;Z-3KB|(Yh3I#>^X_+~x3MG{V zsS23|CCLm76>}bc;^8O^)6h8OfBKB)(;xZee9%@5v&}!U`@8CWlj)l{bed zoW618#E~;cWR9?(Ztz&(rN{6}T(IPmlj&5T6)fqFzK#qG8~eHcB(j3+Pxc7%WnidM zV_;}#VPNrMq>1fP$X`d_r6ucQl)N#sPT{29Sg!pg0hri0=f+TGtnVq}*fCWl{A) z%z>zZn+Y)uA&6=qTo$1KY$lM4EMnbI;JB;B5vq+<)NMiBlkO=Ipuij~+jH`u)eRzyJQdI_~!kWI&R) zyG!7d%o;5q+r`txF{I+w+exSMqz!po&x@KStA9J>+P!7^1Lt0Wqedv zuhi6Q{o;FeyXS(d?i`=H6{Pp5J+%MO-%#hfpZS-w74u%^yNqVhH}V+vZ1z!l!u5c! zXZ7|q$Glz73Mi&Jyt`KUV&+H2D=`j!0*yh+S#s8U?72UwtzhL~sbQvjuPNiWKA*ixzmX8Z4~4a?K%bw*7vM=V}V}b!rWq zSN7hQ?g(4*ibLbKysD15gTC`VV~0s94SVeE7IG`hjoKxhCo@BizgCy&nOiTJTUc4xd$I_#u!2j2$>9`c<;@`q zr*B+2apcSqnIr6{8$1?x=`p+#7cBYYWI7dS1xvc4uOkD)#(wTUiL5}rLb6AYF9SoB z8UsT^3j@P1pisjL28L1t28LG&3=CE?7#PG0=Ijcz0ZOQrxJHzuB$lLF<>sekrd2W+ z85mmX8XD;unS~e_S(zAG8JTJu7+M(^EVW zvY3H^TL^?1FWs&C0~A~x;1lBNxT6`!H1&)FG9U=Zh9DppA-=WAA|u1pJr=GEjR8@K zP!HD&)(A4nJr+gHt`^6gU>mnJIc{xoSX*y5x5{pIrR}6LtFl~+%uJwl<}oQ|L5Ze5 z@j#70?Si)9RzSCElmz(!qm7A;otsZkL{v;d5(sqlEu*4ya`UDxTDR%gg^O3NT)B4b z`pX}G*Pb-d0qS8)@^*Kzyv{Jy0mzx^>EaktajW;lSubWs5!Q!R+v|^MxbXb=m;YQ# zqot?t(&g_vc-Q?Y3tgl;X`6NJ#=X6#UK@&TH(u^+rT5&cvTJE=$1l5WF`Q?Zh5vk< zzwo%o)FaEpt;{@C(+vw%Hlzog?6LIE&+tnRl6X78=}hg5PcNIYzudL_zVK_+;*R-~ w&i*cmyRNU27&ota!uR*0ij2$5j`cOf|4jEg`K&0{0_Z>nPgg&ebxsLQ01xN@Hvj+t literal 0 HcmV?d00001