diff --git a/assets/images/icons.png b/assets/images/icons.png index e7a734d8..463efc06 100644 Binary files a/assets/images/icons.png and b/assets/images/icons.png differ diff --git a/assets/images/icons@2x.png b/assets/images/icons@2x.png index ef9ead26..0d60ca2d 100644 Binary files a/assets/images/icons@2x.png and b/assets/images/icons@2x.png differ diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index 585fcc7a..3d2b9a68 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,7 +1,7 @@ [ [ "2016-02-28", - "New documentations: CodeIgniter and nginx Lua Module" + "New documentations: CodeIgniter, nginx Lua Module and InfluxData" ], [ "2016-02-15", "New documentations: CakePHP, Chef and Ramda" diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 97c37c5f..74c64c86 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -199,6 +199,11 @@ credits = [ 'The University of Glasgow', 'BSD', 'https://www.haskell.org/ghc/license' + ], [ + 'InfluxData', + '2015 InfluxData, Inc.', + 'MIT', + 'https://github.com/influxdata/docs.influxdata.com/blob/master/LICENSE' ], [ 'jQuery', 'Packt Publishing
© jQuery Foundation and other contributors', diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss index 75579c36..9b88ecee 100644 --- a/assets/stylesheets/global/_icons.scss +++ b/assets/stylesheets/global/_icons.scss @@ -128,3 +128,4 @@ ._icon-chef:before { background-position: -2rem -10rem; } ._icon-ramda:before { background-position: -3rem -10rem; @extend %darkIconFix !optional; } ._icon-codeigniter:before { background-position: -4rem -10rem; @extend %darkIconFix !optional; } +._icon-influxdata:before { background-position: -5rem -10rem; @extend %darkIconFix !optional; } diff --git a/assets/stylesheets/pages/_base.scss b/assets/stylesheets/pages/_base.scss index ef7d422d..ae4656f0 100644 --- a/assets/stylesheets/pages/_base.scss +++ b/assets/stylesheets/pages/_base.scss @@ -18,6 +18,7 @@ ._cordova, ._grunt, +._influxdata, ._less, ._lodash, ._marionette, diff --git a/lib/docs/filters/influxdata/clean_html.rb b/lib/docs/filters/influxdata/clean_html.rb new file mode 100644 index 00000000..e86d5782 --- /dev/null +++ b/lib/docs/filters/influxdata/clean_html.rb @@ -0,0 +1,27 @@ +module Docs + class Influxdata + class CleanHtmlFilter < Filter + def call + if root_page? + doc.inner_html = ' ' + return doc + end + + doc = @doc.at_css('#page-content') + + css('.page--contribute', 'hr').remove + + css('.page--body', '.page--title', 'font').each do |node| + node.before(node.children).remove + end + + css('pre > code').each do |node| + node.parent['class'] = node['class'] + node.before(node.children).remove + end + + doc + end + end + end +end diff --git a/lib/docs/filters/influxdata/entries.rb b/lib/docs/filters/influxdata/entries.rb new file mode 100644 index 00000000..9ddea11e --- /dev/null +++ b/lib/docs/filters/influxdata/entries.rb @@ -0,0 +1,30 @@ +module Docs + class Influxdata + class EntriesFilter < Docs::EntriesFilter + def get_name + at_css('#page-title h1').content + end + + def get_type + product = at_css('.product-switcher--current').content.strip + return product if %w(Chronograf Telegraf).include?(product) + + node = at_css('#product-sidebar a[href="index"]') + node = node.parent.previous_element unless node.parent['class'] == 'product-sidebar--section-title' + + type = node.content.strip + type.remove! ' Reference' + + if type.in?(%w(Getting\ Started Introduction Guides)) + product + else + "#{product}: #{type}" + end + end + + def include_default_entry? + !subpath.end_with?("v#{Influxdata.release}/") + end + end + end +end diff --git a/lib/docs/filters/influxdb/clean_html.rb b/lib/docs/filters/influxdb/clean_html.rb deleted file mode 100644 index 8b7544b8..00000000 --- a/lib/docs/filters/influxdb/clean_html.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Docs - class Influxdb - class CleanHtmlFilter < Filter - def call - doc = @doc.at_css('#page-content') - - # Re-position the page header - header = at_css('.page--body h1') - doc.children.first.add_next_sibling header - - # Remove the contribution - at_css('.page--contribute').remove - - doc - end - end - end -end diff --git a/lib/docs/filters/influxdb/entries.rb b/lib/docs/filters/influxdb/entries.rb deleted file mode 100644 index 5b1f4ca9..00000000 --- a/lib/docs/filters/influxdb/entries.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Docs - class Influxdb - class EntriesFilter < Docs::EntriesFilter - - def get_name - at_css('#page-title h1').content - end - - def get_type - # This is kinda hacky, we are fetching the current type from - # the url, we are asumming that the url pattern is - # category/page or category - path = current_url.relative_path_from(base_url) - "InfluxDB: #{path.split('/').first.titleize}" - end - - end - end -end diff --git a/lib/docs/scrapers/influxdata.rb b/lib/docs/scrapers/influxdata.rb new file mode 100644 index 00000000..45d1678f --- /dev/null +++ b/lib/docs/scrapers/influxdata.rb @@ -0,0 +1,32 @@ +module Docs + class Influxdata < UrlScraper + self.name = 'InfluxData' + self.type = 'influxdata' + self.release = '0.10' + self.base_url = 'https://docs.influxdata.com/' + + html_filters.push 'influxdata/entries', 'influxdata/clean_html', 'title' + + options[:trailing_slash] = true + + options[:root_title] = 'InfluxData Documentation' + options[:title] = false + + options[:only_patterns] = [/(telegraf|influxdb|chronograf|kapacitor)\/v#{release}/] + + options[:skip] = [ + "influxdb/v#{release}/sample_data/data_download/", + "influxdb/v#{release}/tools/grafana/", + "influxdb/v#{release}/about/" + ] + + options[:replace_paths] = { + "influxdb/v#{release}/guides/clustering/" => 'influxdb/v0.10/clustering/' + } + + options[:attribution] = <<-HTML + © 2015 InfluxData, Inc.
+ Licensed under the MIT license. + HTML + end +end diff --git a/lib/docs/scrapers/influxdb.rb b/lib/docs/scrapers/influxdb.rb deleted file mode 100644 index bc9eeb8f..00000000 --- a/lib/docs/scrapers/influxdb.rb +++ /dev/null @@ -1,15 +0,0 @@ -module Docs - class Influxdb < UrlScraper - self.name = 'InfluxDB' - self.type = 'influxdb' - self.release = '0.10' - self.base_url = 'https://docs.influxdata.com/influxdb/v0.10/' - - html_filters.push 'influxdb/entries', 'influxdb/clean_html' - - options[:attribution] = <<-HTML - © 2010–2015 InfluxData
- Licensed under the MIT license. - HTML - end -end diff --git a/public/icons/docs/influxdata/16.png b/public/icons/docs/influxdata/16.png new file mode 100644 index 00000000..03ad40a7 Binary files /dev/null and b/public/icons/docs/influxdata/16.png differ diff --git a/public/icons/docs/influxdata/16@2x.png b/public/icons/docs/influxdata/16@2x.png new file mode 100644 index 00000000..f3fddcb7 Binary files /dev/null and b/public/icons/docs/influxdata/16@2x.png differ