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
15app.views.EmberPage =15app.views.EmberPage =
16app.views.ExpressPage =16app.views.ExpressPage =
17app.views.GoPage =17app.views.GoPage =
18app.views.InfluxdataPage =
18app.views.KotlinPage =19app.views.KotlinPage =
19app.views.LaravelPage =20app.views.LaravelPage =
20app.views.LodashPage =21app.views.LodashPage =
lib/docs/filters/influxdata/clean_html.rb+8−4
@@ -7,16 +7,20 @@ module Docs · 6 unmodified lines
7 return doc7 return doc
8 end8 end
9 9
10 doc = @doc.at_css('#page-content')10 doc = @doc.at_css('article')
11 11
12 css('.page--contribute', 'hr').remove12 css('.article-footer', 'hr').remove
13 13
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|
15 node.before(node.children).remove19 node.before(node.children).remove
16 end20 end
17 21
18 css('pre > code').each do |node|22 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']
20 node.before(node.children).remove24 node.before(node.children).remove
21 end25 end
22 26
lib/docs/filters/influxdata/entries.rb+5−4
@@ -2,15 +2,16 @@ module Docs · 1 unmodified line
2 class Influxdata2 class Influxdata
3 class EntriesFilter < Docs::EntriesFilter3 class EntriesFilter < Docs::EntriesFilter
4 def get_name4 def get_name
5 at_css('#page-title h1').content5 at_css('.article-heading h1').content
6 end6 end
7 7
8 def get_type8 def get_type
9 product = at_css('.product-switcher--current').content.strip9 product = at_css('.navbar--current-product').content.split(' ').first.capitalize.sub('db', 'DB')
10 return product if %w(Chronograf Telegraf).include?(product)10 return product if %w(Chronograf Telegraf).include?(product)
11 11
12 node = at_css('#product-sidebar a[href="index"]')12 node = at_css('a.sidebar--page[href="index"]')
13 node = node.parent.previous_element unless node.parent['class'] == 'product-sidebar--section-title'13 node ||= at_css('.sidebar--section-title a[href="index"]').parent
14 node = node.previous_element until node['class'] == 'sidebar--section-title'
14 15
15 type = node.content.strip16 type = node.content.strip
16 type.remove! ' Reference'17 type.remove! ' Reference'
lib/docs/scrapers/influxdata.rb+1−5
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class Influxdata < UrlScraper2 class Influxdata < UrlScraper
3 self.name = 'InfluxData'3 self.name = 'InfluxData'
4 self.type = 'influxdata'4 self.type = 'influxdata'
5 self.release = '0.10'5 self.release = '0.13'
6 self.base_url = 'https://docs.influxdata.com/'6 self.base_url = 'https://docs.influxdata.com/'
7 7
8 html_filters.push 'influxdata/entries', 'influxdata/clean_html', 'title'8 html_filters.push 'influxdata/entries', 'influxdata/clean_html', 'title'
@@ -20,10 +20,6 @@ module Docs · 11 unmodified lines
20 "influxdb/v#{release}/about/"20 "influxdb/v#{release}/about/"
21 ]21 ]
22 22
23 options[:replace_paths] = {
24 "influxdb/v#{release}/guides/clustering/" => 'influxdb/v0.10/clustering/'
25 }
26
27 options[:attribution] = <<-HTML23 options[:attribution] = <<-HTML
28 &copy; 2015 InfluxData, Inc.<br>24 &copy; 2015 InfluxData, Inc.<br>
29 Licensed under the MIT license.25 Licensed under the MIT license.