Add Svelte documentation (3.50.1)

pull/1825/head
Simon Legner 2 years ago
parent 454a9b29a1
commit 8bbbb9e634

@ -1,4 +1,8 @@
[
[
"2022-10-02",
"New documentation: <a href=\"/svelte/\">Svelte</a>"
],
[
"2022-09-21",
"Added HTTP/3 to <a href=\"/http/\">HTTP</a>"

@ -871,6 +871,11 @@ credits = [
'2009-2012 Statsmodels Developers<br>&copy; 2006-2008 Scipy Developers<br>&copy; 2006 Jonathan E. Taylor',
'BSD',
'https://raw.githubusercontent.com/statsmodels/statsmodels/master/LICENSE.txt'
], [
'Svelte',
'20162022 Rich Harris and contributors',
'MIT',
'https://raw.githubusercontent.com/sveltejs/svelte/master/LICENSE.md'
], [
'Symfony',
'2004-2017 Fabien Potencier',

@ -0,0 +1,11 @@
module Docs
class Svelte
class CleanHtmlFilter < Filter
def call
@doc = at_css('main > .content')
at_css('h1').content = 'Svelte'
doc
end
end
end
end

@ -0,0 +1,27 @@
module Docs
class Svelte
class EntriesFilter < Docs::EntriesFilter
def get_type
'Svelte'
end
def additional_entries
type = 'Svelte'
subtype = nil
css('h2, h3, h4').each_with_object [] do |node, entries|
if node.name == 'h2'
type = node.content.strip
subtype = nil
elsif node.name == 'h3'
subtype = node.content.strip
subtype = nil unless subtype[/Component directives|Element directives/]
end
next if type == 'Before we begin'
name = node.content.strip
name.concat " (#{subtype})" if subtype && node.name == 'h4'
entries << [name, node['id'], subtype || type]
end
end
end
end
end

@ -0,0 +1,28 @@
module Docs
class Svelte < UrlScraper
self.name = 'Svelte'
self.slug = 'svelte'
self.type = 'simple'
self.links = {
home: 'https://svelte.dev/',
code: 'https://github.com/sveltejs/svelte'
}
options[:root_title] = 'Svelte'
options[:attribution] = <<-HTML
&copy; 20162022 Rich Harris and contributors<br>
Licensed under the MIT License.
HTML
options[:skip] = %w(team.html plugins/)
self.release = '3.50.1'
self.base_url = 'https://svelte.dev/docs'
html_filters.push 'svelte/entries', 'svelte/clean_html'
def get_latest_version(opts)
get_npm_version('svelte', opts)
end
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -0,0 +1 @@
https://svelte.dev/favicon.png
Loading…
Cancel
Save