Skip to content

Commit 489975d

Browse files
committed
Add i3 documentation
1 parent 38a6506 commit 489975d

File tree

7 files changed

+56
-1
lines changed

7 files changed

+56
-1
lines changed

assets/javascripts/news.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ app.templates.aboutPage = -> """
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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

1.17 KB
Loading
2.11 KB
Loading

public/icons/docs/i3/SOURCE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://github.com/i3/i3.github.io/blob/master/logo.png

0 commit comments

Comments
 (0)