History

Add Svelte documentation (3.50.1)

Simon Legner committed 4 years ago

Commit 8bbbb9e1 parent 454a9b28 files · +74 −-2Browse files

Unified · Split

8 files
  1. assets/javascripts/news.json +4 −0
  2. assets/javascripts/templates/pages/about_tmpl.coffee +5 −0
  3. lib/docs/filters/svelte/clean_html.rb +11 −0
  4. lib/docs/filters/svelte/entries.rb +27 −0
  5. lib/docs/scrapers/svelte.rb +28 −0
  6. public/icons/docs/svelte/16.png +0 −0
  7. public/icons/docs/svelte/16@2x.png +0 −0
  8. public/icons/docs/svelte/SOURCE +1 −0
assets/javascripts/news.json+4−0
@@ -1,4 +1,8 @@
1[1[
2 [
3 "2022-10-02",
4 "New documentation: <a href=\"/svelte/\">Svelte</a>"
5 ],
2 [6 [
3 "2022-09-21",7 "2022-09-21",
4 "Added HTTP/3 to <a href=\"/http/\">HTTP</a>"8 "Added HTTP/3 to <a href=\"/http/\">HTTP</a>"
assets/javascripts/templates/pages/about_tmpl.coffee+5−0
@@ -871,6 +871,11 @@ credits = [ · 870 unmodified lines
871 '2009-2012 Statsmodels Developers<br>&copy; 2006-2008 Scipy Developers<br>&copy; 2006 Jonathan E. Taylor',871 '2009-2012 Statsmodels Developers<br>&copy; 2006-2008 Scipy Developers<br>&copy; 2006 Jonathan E. Taylor',
872 'BSD',872 'BSD',
873 'https://raw.githubusercontent.com/statsmodels/statsmodels/master/LICENSE.txt'873 'https://raw.githubusercontent.com/statsmodels/statsmodels/master/LICENSE.txt'
874 ], [
875 'Svelte',
876 '2016–2022 Rich Harris and contributors',
877 'MIT',
878 'https://raw.githubusercontent.com/sveltejs/svelte/master/LICENSE.md'
874 ], [879 ], [
875 'Symfony',880 'Symfony',
876 '2004-2017 Fabien Potencier',881 '2004-2017 Fabien Potencier',
lib/docs/filters/svelte/clean_html.rb+11−0
@@ -0,0 +1,11 @@
1module Docs
2 class Svelte
3 class CleanHtmlFilter < Filter
4 def call
5 @doc = at_css('main > .content')
6 at_css('h1').content = 'Svelte'
7 doc
8 end
9 end
10 end
11end
lib/docs/filters/svelte/entries.rb+27−0
@@ -0,0 +1,27 @@
1module Docs
2 class Svelte
3 class EntriesFilter < Docs::EntriesFilter
4 def get_type
5 'Svelte'
6 end
7
8 def additional_entries
9 type = 'Svelte'
10 subtype = nil
11 css('h2, h3, h4').each_with_object [] do |node, entries|
12 if node.name == 'h2'
13 type = node.content.strip
14 subtype = nil
15 elsif node.name == 'h3'
16 subtype = node.content.strip
17 subtype = nil unless subtype[/Component directives|Element directives/]
18 end
19 next if type == 'Before we begin'
20 name = node.content.strip
21 name.concat " (#{subtype})" if subtype && node.name == 'h4'
22 entries << [name, node['id'], subtype || type]
23 end
24 end
25 end
26 end
27end
lib/docs/scrapers/svelte.rb+28−0
@@ -0,0 +1,28 @@
1module Docs
2 class Svelte < UrlScraper
3 self.name = 'Svelte'
4 self.slug = 'svelte'
5 self.type = 'simple'
6 self.links = {
7 home: 'https://svelte.dev/',
8 code: 'https://github.com/sveltejs/svelte'
9 }
10
11 options[:root_title] = 'Svelte'
12
13 options[:attribution] = <<-HTML
14 &copy; 2016–2022 Rich Harris and contributors<br>
15 Licensed under the MIT License.
16 HTML
17
18 options[:skip] = %w(team.html plugins/)
19
20 self.release = '3.50.1'
21 self.base_url = 'https://svelte.dev/docs'
22 html_filters.push 'svelte/entries', 'svelte/clean_html'
23
24 def get_latest_version(opts)
25 get_npm_version('svelte', opts)
26 end
27 end
28end
public/icons/docs/svelte/16.png+0−0

Binary file not shown.

public/icons/docs/svelte/16@2x.png+0−0

Binary file not shown.

public/icons/docs/svelte/SOURCE+1−0
@@ -0,0 +1 @@
1https://svelte.dev/favicon.png