Update InfluxData documentation (0.13)

pull/447/merge
Thibaut Courouble 9 years ago
parent e283803e4e
commit 1f3ee96056

@ -15,6 +15,7 @@ app.views.ElixirPage =
app.views.EmberPage = app.views.EmberPage =
app.views.ExpressPage = app.views.ExpressPage =
app.views.GoPage = app.views.GoPage =
app.views.InfluxdataPage =
app.views.KotlinPage = app.views.KotlinPage =
app.views.LaravelPage = app.views.LaravelPage =
app.views.LodashPage = app.views.LodashPage =

@ -7,16 +7,20 @@ module Docs
return doc return doc
end end
doc = @doc.at_css('#page-content') doc = @doc.at_css('article')
css('.page--contribute', 'hr').remove css('.article-footer', 'hr').remove
css('.page--body', '.page--title', 'font').each do |node| css('a.offset-anchor').each do |node|
node.parent['id'] = node['id']
end
css('.article-content', '.article-section', 'font').each do |node|
node.before(node.children).remove node.before(node.children).remove
end end
css('pre > code').each do |node| css('pre > code').each do |node|
node.parent['class'] = node['class'] node.parent['data-language'] = node['class'][/language-(\w+)/, 1] if node['class']
node.before(node.children).remove node.before(node.children).remove
end end

@ -2,15 +2,16 @@ module Docs
class Influxdata class Influxdata
class EntriesFilter < Docs::EntriesFilter class EntriesFilter < Docs::EntriesFilter
def get_name def get_name
at_css('#page-title h1').content at_css('.article-heading h1').content
end end
def get_type def get_type
product = at_css('.product-switcher--current').content.strip product = at_css('.navbar--current-product').content.split(' ').first.capitalize.sub('db', 'DB')
return product if %w(Chronograf Telegraf).include?(product) return product if %w(Chronograf Telegraf).include?(product)
node = at_css('#product-sidebar a[href="index"]') node = at_css('a.sidebar--page[href="index"]')
node = node.parent.previous_element unless node.parent['class'] == 'product-sidebar--section-title' node ||= at_css('.sidebar--section-title a[href="index"]').parent
node = node.previous_element until node['class'] == 'sidebar--section-title'
type = node.content.strip type = node.content.strip
type.remove! ' Reference' type.remove! ' Reference'

@ -2,7 +2,7 @@ module Docs
class Influxdata < UrlScraper class Influxdata < UrlScraper
self.name = 'InfluxData' self.name = 'InfluxData'
self.type = 'influxdata' self.type = 'influxdata'
self.release = '0.10' self.release = '0.13'
self.base_url = 'https://docs.influxdata.com/' self.base_url = 'https://docs.influxdata.com/'
html_filters.push 'influxdata/entries', 'influxdata/clean_html', 'title' html_filters.push 'influxdata/entries', 'influxdata/clean_html', 'title'
@ -20,10 +20,6 @@ module Docs
"influxdb/v#{release}/about/" "influxdb/v#{release}/about/"
] ]
options[:replace_paths] = {
"influxdb/v#{release}/guides/clustering/" => 'influxdb/v0.10/clustering/'
}
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2015 InfluxData, Inc.<br> &copy; 2015 InfluxData, Inc.<br>
Licensed under the MIT license. Licensed under the MIT license.

Loading…
Cancel
Save