History

Add i3 documentation

Simon Legner committed 4 years ago

Commit 489975d1 parent 38a65067 files · +54 −-1Browse files

Unified · Split

7 files
  1. assets/javascripts/news.json +4 −0
  2. assets/javascripts/templates/pages/about_tmpl.coffee +6 −1
  3. lib/docs/filters/i3/entries.rb +17 −0
  4. lib/docs/scrapers/i3.rb +28 −0
  5. public/icons/docs/i3/16.png +0 −0
  6. public/icons/docs/i3/16@2x.png +0 −0
  7. public/icons/docs/i3/SOURCE +1 −0
assets/javascripts/news.json+4−0
@@ -1,4 +1,8 @@
11 [
2+ [
3+ "2021-11-29",
4+ "New documentation: <a href=\"/i3/\">i3</a>"
5+ ],
26 [
37 "2021-06-09",
48 "New documentation: <a href=\"/r/\">R</a>"
assets/javascripts/templates/pages/about_tmpl.coffee+6−1
@@ -82,7 +82,12 @@ app.templates.aboutPage = -> """ · 81 unmodified lines
8282 """
8383
8484 credits = [
85− [ 'Angular.js',
85+ [ 'i3',
86+ '2009, Michael Stapelberg and contributors',
87+ 'BSD',
88+ 'https://raw.githubusercontent.com/i3/i3/next/LICENSE'
89+ ], [
90+ 'Angular.js',
8691 '2010-2020 Google, Inc.',
8792 'CC BY 3.0',
8893 'https://creativecommons.org/licenses/by/3.0/'
lib/docs/filters/i3/entries.rb+17−0
@@ -0,0 +1,17 @@
1+module Docs
2+ class I3
3+ class EntriesFilter < Docs::EntriesFilter
4+ def additional_entries
5+ entries = []
6+ type = nil
7+ css('h2[id], h3[id]').each do |node|
8+ if node.name == 'h2' && node['id']
9+ type = node.content
10+ end
11+ entries << [node.content, node['id'], type]
12+ end
13+ entries
14+ end
15+ end
16+ end
17+end
lib/docs/scrapers/i3.rb+28−0
@@ -0,0 +1,28 @@
1+module Docs
2+ class I3 < UrlScraper
3+ self.name = 'i3'
4+ self.type = 'simple'
5+ self.slug = 'i3'
6+ self.release = '4.20.1'
7+ self.base_url = 'https://i3wm.org/docs/userguide.html'
8+ self.links = {
9+ home: 'https://i3wm.org/',
10+ code: 'https://github.com/i3/i3'
11+ }
12+
13+ html_filters.push 'i3/entries', 'title'
14+
15+ options[:container] = 'main'
16+ options[:skip_links] = true
17+
18+ options[:attribution] = <<-HTML
19+ &copy; 2009, Michael Stapelberg and contributors
20+ HTML
21+
22+ def get_latest_version(opts)
23+ tags = get_github_tags('i3', 'i3', opts)
24+ tag = tags.find {|tag| tag['name'].start_with?('4.')}
25+ tag['name']
26+ end
27+ end
28+end
public/icons/docs/i3/16.png+0−0

Binary file not shown.

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

Binary file not shown.

public/icons/docs/i3/SOURCE+1−0
@@ -0,0 +1 @@
1+https://github.com/i3/i3.github.io/blob/master/logo.png