mirror of https://github.com/freeCodeCamp/devdocs
commit
1a22ee32df
@ -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>')
|
||||
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
|
@ -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
|
@ -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<br>
|
||||
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
|
After Width: | Height: | Size: 893 B |
After Width: | Height: | Size: 970 B |
@ -0,0 +1,2 @@
|
||||
https://github.com/vueuse/vueuse/blob/main/packages/public/favicon-16x16.png
|
||||
https://github.com/vueuse/vueuse/blob/main/packages/public/favicon-32x32.png
|
After Width: | Height: | Size: 702 B |
Loading…
Reference in new issue