From 489975da835e31492c3858a8d414d52facfa5ed8 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Mon, 29 Nov 2021 18:23:14 +0100 Subject: [PATCH] Add i3 documentation --- assets/javascripts/news.json | 4 +++ .../templates/pages/about_tmpl.coffee | 7 ++++- lib/docs/filters/i3/entries.rb | 17 +++++++++++ lib/docs/scrapers/i3.rb | 28 ++++++++++++++++++ public/icons/docs/i3/16.png | Bin 0 -> 1203 bytes public/icons/docs/i3/16@2x.png | Bin 0 -> 2162 bytes public/icons/docs/i3/SOURCE | 1 + 7 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 lib/docs/filters/i3/entries.rb create mode 100644 lib/docs/scrapers/i3.rb create mode 100644 public/icons/docs/i3/16.png create mode 100644 public/icons/docs/i3/16@2x.png create mode 100644 public/icons/docs/i3/SOURCE diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index cae61ade..d5b52149 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,4 +1,8 @@ [ + [ + "2021-11-29", + "New documentation: i3" + ], [ "2021-06-09", "New documentation: R" diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index c27816c5..14083f41 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -82,7 +82,12 @@ app.templates.aboutPage = -> """ """ credits = [ - [ 'Angular.js', + [ 'i3', + '2009, Michael Stapelberg and contributors', + 'BSD', + 'https://raw.githubusercontent.com/i3/i3/next/LICENSE' + ], [ + 'Angular.js', '2010-2020 Google, Inc.', 'CC BY 3.0', 'https://creativecommons.org/licenses/by/3.0/' diff --git a/lib/docs/filters/i3/entries.rb b/lib/docs/filters/i3/entries.rb new file mode 100644 index 00000000..0992fec0 --- /dev/null +++ b/lib/docs/filters/i3/entries.rb @@ -0,0 +1,17 @@ +module Docs + class I3 + class EntriesFilter < Docs::EntriesFilter + def additional_entries + entries = [] + type = nil + css('h2[id], h3[id]').each do |node| + if node.name == 'h2' && node['id'] + type = node.content + end + entries << [node.content, node['id'], type] + end + entries + end + end + end +end diff --git a/lib/docs/scrapers/i3.rb b/lib/docs/scrapers/i3.rb new file mode 100644 index 00000000..abc4e791 --- /dev/null +++ b/lib/docs/scrapers/i3.rb @@ -0,0 +1,28 @@ +module Docs + class I3 < UrlScraper + self.name = 'i3' + self.type = 'simple' + self.slug = 'i3' + self.release = '4.20.1' + self.base_url = 'https://i3wm.org/docs/userguide.html' + self.links = { + home: 'https://i3wm.org/', + code: 'https://github.com/i3/i3' + } + + html_filters.push 'i3/entries', 'title' + + options[:container] = 'main' + options[:skip_links] = true + + options[:attribution] = <<-HTML + © 2009, Michael Stapelberg and contributors + HTML + + def get_latest_version(opts) + tags = get_github_tags('i3', 'i3', opts) + tag = tags.find {|tag| tag['name'].start_with?('4.')} + tag['name'] + end + end +end diff --git a/public/icons/docs/i3/16.png b/public/icons/docs/i3/16.png new file mode 100644 index 0000000000000000000000000000000000000000..d53f01271fbd819e78354a026f16d0e51ecc2b20 GIT binary patch literal 1203 zcmV;k1WfyhP)z@;j|==^ z1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF*m;eA5aGbhPJOBUy2XskI zMF-^z9T65G66^8|00009a7bBm000fw000fw0YWI7cmMzb#86CBMdIk}-{k1qCN5g z%-rX~+3L#H-@(`Dz}Du#)a1m`+`-S=!Oz;U)9kL&?7qy{v(MzS&f}ub@Vdy=xX9O? z(Dbv(+?mk$oy_i<%<-ql;j_fktHs)s%k!wk+>yxfsKM5c$MKTJ?3KmnmBiYcmPnY-1Rxzm-p*p|80mATf4y5EPo--5g4pt8i0w$p{U-GsQ` ziniC8vB!(F)q}R)kh0H(wAp^P;exf>i?Y&xwcd}f%aN|ffV0_sv)qlY%YU-kezDnp zu-JXD+J>ymg{;kcuGD+1)OoDaf~m@Qs?v9=(s!xScc{>HsLyt%&w-@DeWk{9r_O?+ zzjCI~b*0UGqr`Ni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