diff --git a/assets/images/icons.png b/assets/images/icons.png index b73d7475..b49c62a4 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 413354ab..f5f4a181 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 c7171c97..ef4ea66c 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,5 +1,8 @@ [ [ + "2015-08-02", + "New documentation: OpenTSDB" + ], [ "2015-07-26", "Added search abbreviations (e.g. $ is an alias for jQuery).\nClick here to see the full list. Feel free to suggest more on GitHub.", "Added shift + ↓/↑ shortcut for scrolling (same as alt + ↓/↑)." diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index a5b96595..acb12296 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -274,6 +274,11 @@ credits = [ 'npm, Inc. and Contributors
npm is a trademark of npm, Inc.', 'npm', 'https://raw.githubusercontent.com/npm/npm/master/LICENSE' + ], [ + 'OpenTSDB', + '2010-2015 The OpenTSDB Authors', + 'LGPLv2.1', + 'https://raw.githubusercontent.com/OpenTSDB/opentsdb.net/gh-pages/COPYING.LESSER' ], [ 'Phaser', '2015 Richard Davey, Photon Storm Ltd.', diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss index 684e6349..51665043 100644 --- a/assets/stylesheets/global/_icons.scss +++ b/assets/stylesheets/global/_icons.scss @@ -105,3 +105,4 @@ ._icon-webpack:before { background-position: -1rem -8rem; @extend %darkIconFix !optional; } ._icon-phaser:before { background-position: -2rem -8rem; } ._icon-vue:before { background-position: -3rem -8rem; } +._icon-opentsdb:before { background-position: -4rem -8rem; } diff --git a/assets/stylesheets/pages/_opentsdb.scss b/assets/stylesheets/pages/_opentsdb.scss index 7abe9351..308f1c46 100644 --- a/assets/stylesheets/pages/_opentsdb.scss +++ b/assets/stylesheets/pages/_opentsdb.scss @@ -1,7 +1,10 @@ -._opentsdb .section { - > h2 { @extend %block-heading; } - > h3 { @extend %block-label, %label-blue; } - > h4 { font-size: 1em; } +._opentsdb { + @extend %simple; + .admonition { @extend %note; } + .admonition.warning { @extend %note-orange; } + .admonition-title { + margin: 0 0 .25rem; + font-weight: bold; + } } - diff --git a/lib/docs/filters/opentsdb/clean_html.rb b/lib/docs/filters/opentsdb/clean_html.rb index dd3c351d..94d95b45 100644 --- a/lib/docs/filters/opentsdb/clean_html.rb +++ b/lib/docs/filters/opentsdb/clean_html.rb @@ -1,13 +1,24 @@ module Docs - class Opentsdb + class Opentsdb class CleanHtmlFilter < Filter def call - # Reset the page scope to the body, - # we needed the rest of the page for the entries filter. - @doc = at_css(".documentwrapper > .bodywrapper > .body > .section") + @doc = at_css('.documentwrapper > .bodywrapper > .body > .section') - # Remove table borders - css('table').each { |table| table.delete 'border' } + css('> .section').each do |node| + node.before(node.children).remove + end + + css('tt.literal').each do |node| + node.name = 'code' + node.content = node.content + end + + css('div[class*=highlight] .highlight pre').each do |node| + node.parent.parent.before(node) + node.content = node.content.gsub(' ', ' ') + end + + css('table').remove_attr('border') doc end diff --git a/lib/docs/filters/opentsdb/entries.rb b/lib/docs/filters/opentsdb/entries.rb index adb5a3c5..3f947dfe 100644 --- a/lib/docs/filters/opentsdb/entries.rb +++ b/lib/docs/filters/opentsdb/entries.rb @@ -1,34 +1,24 @@ module Docs - class Opentsdb + class Opentsdb class EntriesFilter < Docs::EntriesFilter - def get_name - header = css(".section > h1").first - return header.content.strip unless header.nil? + at_css('.section > h1').content end def get_type - return nil if breadcrumbs.length < 2 - - # This is time for a little bit of cheating - return breadcrumbs[1] if breadcrumbs.include? "HTTP API" - - breadcrumbs.last - end - - def additional_entries - [] + if subpath.start_with?('api_http') + 'HTTP API' + elsif slug.end_with?('/index') + [breadcrumbs[1], name].compact.join(': ') + elsif breadcrumbs.length < 2 + 'Miscellaneous' + else + breadcrumbs[1..2].join(': ') + end end - def breadcrumbs - nav_links = css(".related").first.css("li") - breadcrumbs = nav_links.reject do |node| - node['class'] == "right" - end - - breadcrumbs.map { |node| node.at_css("a").content } - .reject { |link| link.empty? } + @breakcrumbs ||= at_css('.related').css('li:not(.right) a').map(&:content).reject(&:blank?) end end end diff --git a/lib/docs/scrapers/opentsdb.rb b/lib/docs/scrapers/opentsdb.rb index 0c27cf35..7b9f4e76 100644 --- a/lib/docs/scrapers/opentsdb.rb +++ b/lib/docs/scrapers/opentsdb.rb @@ -2,18 +2,21 @@ module Docs class Opentsdb < UrlScraper self.name = 'OpenTSDB' self.type = 'opentsdb' - self.version = '2.1' + self.version = '2.1.0' self.base_url = 'http://opentsdb.net/docs/build/html/' self.root_path = 'index.html' + self.links = { + home: 'http://opentsdb.net/', + code: 'https://github.com/OpenTSDB/opentsdb' + } html_filters.push 'opentsdb/entries', 'opentsdb/clean_html' - options[:skip] = %w(genindex.html search.html) - options[:attribution] = <<-HTML - © 2015 OpenTSDB + © 2010–2015 The OpenTSDB Authors
+ Licensed under the GNU LGPLv2.1+ and GPLv3+ licenses. HTML end end diff --git a/public/icons/docs/opentsdb/16.png b/public/icons/docs/opentsdb/16.png index 4a7066cc..f19b4f61 100644 Binary files a/public/icons/docs/opentsdb/16.png and b/public/icons/docs/opentsdb/16.png differ diff --git a/public/icons/docs/opentsdb/16@2x.png b/public/icons/docs/opentsdb/16@2x.png index 25ecb052..4d49f50f 100644 Binary files a/public/icons/docs/opentsdb/16@2x.png and b/public/icons/docs/opentsdb/16@2x.png differ