mirror of https://github.com/freeCodeCamp/devdocs
parent
4d03b4aec6
commit
cd41d39abc
@ -0,0 +1,28 @@
|
||||
module Docs
|
||||
class Vitest
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
name = at_css('h1').content
|
||||
name.sub! %r{\s*#\s*}, ''
|
||||
name
|
||||
end
|
||||
|
||||
def get_type
|
||||
name = at_css('h1').content
|
||||
name.sub! %r{\s*#\s*}, ''
|
||||
name
|
||||
end
|
||||
|
||||
def additional_entries
|
||||
return [] if root_page?
|
||||
css('h2[id], h3[id]').each_with_object [] do |node, entries|
|
||||
text = node.content.strip
|
||||
text.sub! %r{\s*#\s*}, ''
|
||||
next if text == 'Example'
|
||||
text.prepend "#{name}: " unless slug.starts_with?('api') || slug.starts_with?('config')
|
||||
entries << [text, node['id']]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,28 @@
|
||||
module Docs
|
||||
class Vitest < UrlScraper
|
||||
self.name = 'Vitest'
|
||||
self.slug = 'vitest'
|
||||
self.type = 'simple'
|
||||
self.links = {
|
||||
home: 'https://vitest.dev/',
|
||||
code: 'https://github.com/vitest-dev/vitest'
|
||||
}
|
||||
|
||||
options[:root_title] = 'Vitest'
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2021-Present Anthony Fu<br>
|
||||
© 2021-Present Matias Capeletto<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
|
||||
self.release = '0.24.0'
|
||||
self.base_url = 'https://vitest.dev/'
|
||||
self.initial_paths = %w(guide/)
|
||||
html_filters.push 'vitest/entries', 'vite/clean_html'
|
||||
|
||||
def get_latest_version(opts)
|
||||
get_npm_version('vitest', opts)
|
||||
end
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 893 B |
After Width: | Height: | Size: 1.6 KiB |
@ -0,0 +1 @@
|
||||
https://vitest.dev/logo.svg
|
Loading…
Reference in new issue