Unified · Split
| @@ -0,0 +1,9 @@ | |||
| 1 | module Docs | ||
| 2 | class Jq | ||
| 3 | class CleanHtmlFilter < Filter | ||
| 4 | def call | ||
| 5 | at_css('div#manualcontent') | ||
| 6 | end | ||
| 7 | end | ||
| 8 | end | ||
| 9 | end | ||
| @@ -0,0 +1,20 @@ | |||
| 1 | module Docs | ||
| 2 | class Jq | ||
| 3 | class EntriesFilter < Docs::EntriesFilter | ||
| 4 | def include_default_entry? | ||
| 5 | false | ||
| 6 | end | ||
| 7 | |||
| 8 | def additional_entries | ||
| 9 | entries = [] | ||
| 10 | css('#manualcontent > section').each do |node| | ||
| 11 | type = node.at_css('h2').content | ||
| 12 | node.css('> section').each do |n| | ||
| 13 | entries << [n.at_css('h3').content, n['id'], type] | ||
| 14 | end | ||
| 15 | end | ||
| 16 | return entries | ||
| 17 | end | ||
| 18 | end | ||
| 19 | end | ||
| 20 | end | ||
| @@ -0,0 +1,23 @@ | |||
| 1 | module Docs | ||
| 2 | class Jq < UrlScraper | ||
| 3 | self.name = 'jq' | ||
| 4 | self.slug = 'jq' | ||
| 5 | self.type = 'simple' | ||
| 6 | self.release = '1.6' | ||
| 7 | self.links = { | ||
| 8 | home: 'https://stedolan.github.io/jq/' | ||
| 9 | } | ||
| 10 | |||
| 11 | self.base_url = "https://stedolan.github.io/jq/manual/v#{self.release}/index.html" | ||
| 12 | |||
| 13 | html_filters.push 'jq/entries', 'jq/clean_html' | ||
| 14 | |||
| 15 | options[:skip_links] = true | ||
| 16 | |||
| 17 | options[:attribution] = <<-HTML | ||
| 18 | © 2012 Stephen Dolan<br> | ||
| 19 | Licensed under the <a href="https://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 license</a> | ||
| 20 | HTML | ||
| 21 | |||
| 22 | end | ||
| 23 | end | ||
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | |||
| 1 | https://stedolan.github.io/jq/jq.png | ||