Showing the changes to lib/docs (2 of 7 files). Show all
Unified · Split
| @@ -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 | ||
| @@ -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 | © 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 | ||