Unified · Split
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | [ |
| 2 | 2 | [ |
| 3 | 3 | "2022-10-09", |
| 4 | − "New documentation: <a href=\"/fastapi/\">FastAPI</a>" | |
| 4 | + "New documentations: <a href=\"/fastapi/\">FastAPI</a>, <a href=\"/vitest/\">Vitest</a>" | |
| 5 | 5 | ], |
| 6 | 6 | [ |
| 7 | 7 | "2022-10-02", |
| @@ -936,6 +936,11 @@ credits = [ · 935 unmodified lines | ||
| 936 | 936 | '2019–present, Yuxi (Evan) You and Vite contributors', |
| 937 | 937 | 'MIT', |
| 938 | 938 | 'https://github.com/vitejs/vite/blob/main/LICENSE' |
| 939 | + ], [ | |
| 940 | + 'Vitest', | |
| 941 | + '2021-Present Anthony Fu<br>2021-Present Matias Capeletto<br>', | |
| 942 | + 'MIT', | |
| 943 | + 'https://github.com/vitest-dev/vitest/blob/main/LICENSE' | |
| 939 | 944 | ], [ |
| 940 | 945 | 'Vue Router', |
| 941 | 946 | '2013-present Evan You', |
| @@ -2,6 +2,7 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Vite |
| 3 | 3 | class CleanHtmlFilter < Filter |
| 4 | 4 | def call |
| 5 | + return "<h1>Vitest</h1><p>A Vite-native unit test framework. It's fast!</p>" if root_page? && current_url.host == 'vitest.dev' | |
| 5 | 6 | return '<h1>Vite</h1>' if root_page? |
| 6 | 7 | @doc = at_css('main h1').parent |
| 7 | 8 | |
| @@ -0,0 +1,28 @@ | ||
| 1 | +module Docs | |
| 2 | + class Vitest | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + def get_name | |
| 5 | + name = at_css('h1').content | |
| 6 | + name.sub! %r{\s*#\s*}, '' | |
| 7 | + name | |
| 8 | + end | |
| 9 | + | |
| 10 | + def get_type | |
| 11 | + name = at_css('h1').content | |
| 12 | + name.sub! %r{\s*#\s*}, '' | |
| 13 | + name | |
| 14 | + end | |
| 15 | + | |
| 16 | + def additional_entries | |
| 17 | + return [] if root_page? | |
| 18 | + css('h2[id], h3[id]').each_with_object [] do |node, entries| | |
| 19 | + text = node.content.strip | |
| 20 | + text.sub! %r{\s*#\s*}, '' | |
| 21 | + next if text == 'Example' | |
| 22 | + text.prepend "#{name}: " unless slug.starts_with?('api') || slug.starts_with?('config') | |
| 23 | + entries << [text, node['id']] | |
| 24 | + end | |
| 25 | + end | |
| 26 | + end | |
| 27 | + end | |
| 28 | +end | |
| @@ -0,0 +1,28 @@ | ||
| 1 | +module Docs | |
| 2 | + class Vitest < UrlScraper | |
| 3 | + self.name = 'Vitest' | |
| 4 | + self.slug = 'vitest' | |
| 5 | + self.type = 'simple' | |
| 6 | + self.links = { | |
| 7 | + home: 'https://vitest.dev/', | |
| 8 | + code: 'https://github.com/vitest-dev/vitest' | |
| 9 | + } | |
| 10 | + | |
| 11 | + options[:root_title] = 'Vitest' | |
| 12 | + | |
| 13 | + options[:attribution] = <<-HTML | |
| 14 | + © 2021-Present Anthony Fu<br> | |
| 15 | + © 2021-Present Matias Capeletto<br> | |
| 16 | + Licensed under the MIT License. | |
| 17 | + HTML | |
| 18 | + | |
| 19 | + self.release = '0.24.0' | |
| 20 | + self.base_url = 'https://vitest.dev/' | |
| 21 | + self.initial_paths = %w(guide/) | |
| 22 | + html_filters.push 'vitest/entries', 'vite/clean_html' | |
| 23 | + | |
| 24 | + def get_latest_version(opts) | |
| 25 | + get_npm_version('vitest', opts) | |
| 26 | + end | |
| 27 | + end | |
| 28 | +end | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://vitest.dev/logo.svg | |