History

Update InfluxData documentation (0.13)

Thibaut Courouble committed 10 years ago

Commit 1f3ee961 parent e2838034 files · +15 −13Browse files

Unified · Split

4 files
  1. assets/javascripts/views/pages/simple.coffee +1 −0
  2. lib/docs/filters/influxdata/clean_html.rb +8 −4
  3. lib/docs/filters/influxdata/entries.rb +5 −4
  4. lib/docs/scrapers/influxdata.rb +1 −5
assets/javascripts/views/pages/simple.coffee+1−0
@@ -15,6 +15,7 @@ app.views.ElixirPage = · 14 unmodified lines
1515 app.views.EmberPage =
1616 app.views.ExpressPage =
1717 app.views.GoPage =
18+app.views.InfluxdataPage =
1819 app.views.KotlinPage =
1920 app.views.LaravelPage =
2021 app.views.LodashPage =
lib/docs/filters/influxdata/clean_html.rb+8−4
@@ -7,16 +7,20 @@ module Docs · 6 unmodified lines
77 return doc
88 end
99
10− doc = @doc.at_css('#page-content')
10+ doc = @doc.at_css('article')
1111
12− css('.page--contribute', 'hr').remove
12+ css('.article-footer', 'hr').remove
1313
14− css('.page--body', '.page--title', 'font').each do |node|
14+ css('a.offset-anchor').each do |node|
15+ node.parent['id'] = node['id']
16+ end
17+
18+ css('.article-content', '.article-section', 'font').each do |node|
1519 node.before(node.children).remove
1620 end
1721
1822 css('pre > code').each do |node|
19− node.parent['class'] = node['class']
23+ node.parent['data-language'] = node['class'][/language-(\w+)/, 1] if node['class']
2024 node.before(node.children).remove
2125 end
2226
lib/docs/filters/influxdata/entries.rb+5−4
@@ -2,15 +2,16 @@ module Docs · 1 unmodified line
22 class Influxdata
33 class EntriesFilter < Docs::EntriesFilter
44 def get_name
5− at_css('#page-title h1').content
5+ at_css('.article-heading h1').content
66 end
77
88 def get_type
9− product = at_css('.product-switcher--current').content.strip
9+ product = at_css('.navbar--current-product').content.split(' ').first.capitalize.sub('db', 'DB')
1010 return product if %w(Chronograf Telegraf).include?(product)
1111
12− node = at_css('#product-sidebar a[href="index"]')
13− node = node.parent.previous_element unless node.parent['class'] == 'product-sidebar--section-title'
12+ node = at_css('a.sidebar--page[href="index"]')
13+ node ||= at_css('.sidebar--section-title a[href="index"]').parent
14+ node = node.previous_element until node['class'] == 'sidebar--section-title'
1415
1516 type = node.content.strip
1617 type.remove! ' Reference'
lib/docs/scrapers/influxdata.rb+1−5
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
22 class Influxdata < UrlScraper
33 self.name = 'InfluxData'
44 self.type = 'influxdata'
5− self.release = '0.10'
5+ self.release = '0.13'
66 self.base_url = 'https://docs.influxdata.com/'
77
88 html_filters.push 'influxdata/entries', 'influxdata/clean_html', 'title'
@@ -20,10 +20,6 @@ module Docs · 11 unmodified lines
2020 "influxdb/v#{release}/about/"
2121 ]
2222
23− options[:replace_paths] = {
24− "influxdb/v#{release}/guides/clustering/" => 'influxdb/v0.10/clustering/'
25− }
26−
2723 options[:attribution] = <<-HTML
2824 &copy; 2015 InfluxData, Inc.<br>
2925 Licensed under the MIT license.