Unified · Split
| @@ -0,0 +1,18 @@ | |||
| 1 | module Docs | ||
| 2 | class Influxdb | ||
| 3 | class CleanHtmlFilter < Filter | ||
| 4 | def call | ||
| 5 | doc = @doc.at_css('#page-content') | ||
| 6 | |||
| 7 | # Re-position the page header | ||
| 8 | header = at_css('.page--body h1') | ||
| 9 | doc.children.first.add_next_sibling header | ||
| 10 | |||
| 11 | # Remove the contribution | ||
| 12 | at_css('.page--contribute').remove | ||
| 13 | |||
| 14 | doc | ||
| 15 | end | ||
| 16 | end | ||
| 17 | end | ||
| 18 | end | ||
| @@ -0,0 +1,19 @@ | |||
| 1 | module Docs | ||
| 2 | class Influxdb | ||
| 3 | class EntriesFilter < Docs::EntriesFilter | ||
| 4 | |||
| 5 | def get_name | ||
| 6 | at_css('#page-title h1').content | ||
| 7 | end | ||
| 8 | |||
| 9 | def get_type | ||
| 10 | # This is kinda hacky, we are fetching the current type from | ||
| 11 | # the url, we are asumming that the url pattern is | ||
| 12 | # category/page or category | ||
| 13 | path = current_url.relative_path_from(base_url) | ||
| 14 | "InfluxDB: #{path.split('/').first.titleize}" | ||
| 15 | end | ||
| 16 | |||
| 17 | end | ||
| 18 | end | ||
| 19 | end | ||
| @@ -0,0 +1,15 @@ | |||
| 1 | module Docs | ||
| 2 | class Influxdb < UrlScraper | ||
| 3 | self.name = 'InfluxDB' | ||
| 4 | self.type = 'influxdb' | ||
| 5 | self.release = '0.10' | ||
| 6 | self.base_url = 'https://docs.influxdata.com/influxdb/v0.10/' | ||
| 7 | |||
| 8 | html_filters.push 'influxdb/entries', 'influxdb/clean_html' | ||
| 9 | |||
| 10 | options[:attribution] = <<-HTML | ||
| 11 | © 2010–2015 InfluxData<br> | ||
| 12 | Licensed under the MIT license. | ||
| 13 | HTML | ||
| 14 | end | ||
| 15 | end | ||