influxdata.rb 951 B

12345678910111213141516171819202122232425262728293031323334
  1. module Docs
  2. class Influxdata < UrlScraper
  3. self.name = 'InfluxData'
  4. self.type = 'influxdata'
  5. self.release = '1.0'
  6. self.base_url = 'https://docs.influxdata.com/'
  7. html_filters.push 'influxdata/entries', 'influxdata/clean_html', 'title'
  8. options[:trailing_slash] = true
  9. options[:root_title] = 'InfluxData Documentation'
  10. options[:title] = false
  11. options[:only_patterns] = [/(telegraf|influxdb|chronograf|kapacitor)\/v#{release}/]
  12. options[:skip] = [
  13. "influxdb/v#{release}/sample_data/data_download/",
  14. "influxdb/v#{release}/tools/grafana/",
  15. "influxdb/v#{release}/about/",
  16. "influxdb/v#{release}/external_resources/"
  17. ]
  18. options[:fix_urls] = ->(url) do
  19. url.sub! %r{/influxdb/v([\d\.]+)/.+/influxdb/v[\d\.]+/}, '/influxdb/v\1/'
  20. url
  21. end
  22. options[:attribution] = <<-HTML
  23. &copy; 2015 InfluxData, Inc.<br>
  24. Licensed under the MIT license.
  25. HTML
  26. end
  27. end