History

OpenTSDB 2.1 Documentation

Yosi Attias committed 11 years ago

Commit f6df8471 parent b9a038d8 files · +77 −0Browse files

Unified · Split

8 files
  1. assets/stylesheets/application-dark.css.scss +1 −1
  2. assets/stylesheets/application.css.scss +1 −1
  3. assets/stylesheets/pages/_opentsdb.scss +7 −0
  4. lib/docs/filters/opentsdb/clean_html.rb +16 −0
  5. lib/docs/filters/opentsdb/entries.rb +35 −0
  6. lib/docs/scrapers/opentsdb.rb +19 −0
  7. public/icons/docs/opentsdb/16.png +0 −0
  8. public/icons/docs/opentsdb/16@2x.png +0 −0
assets/stylesheets/application-dark.css.scss+1−1
@@ -54,6 +54,7 @@ · 53 unmodified lines
5454 'pages/nginx',
5555 'pages/node',
5656 'pages/npm',
57+ 'pages/opentsdb',
5758 'pages/phaser',
5859 'pages/php',
5960 'pages/phpunit',
@@ -68,6 +69,5 @@ · 8 unmodified lines
6869 'pages/socketio',
6970 'pages/sphinx',
7071 'pages/underscore',
71− 'pages/vue',
7272 'pages/yard',
7373 'pages/yii';
assets/stylesheets/application.css.scss+1−1
@@ -54,6 +54,7 @@ · 53 unmodified lines
5454 'pages/nginx',
5555 'pages/node',
5656 'pages/npm',
57+ 'pages/opentsdb',
5758 'pages/phaser',
5859 'pages/php',
5960 'pages/phpunit',
@@ -68,6 +69,5 @@ · 8 unmodified lines
6869 'pages/socketio',
6970 'pages/sphinx',
7071 'pages/underscore',
71− 'pages/vue',
7272 'pages/yard',
7373 'pages/yii';
assets/stylesheets/pages/_opentsdb.scss+7−0
@@ -0,0 +1,7 @@
1+._opentsdb .section {
2+ > h2 { @extend %block-heading; }
3+ > h3 { @extend %block-label, %label-blue; }
4+ > h4 { font-size: 1em; }
5+
6+}
7+
lib/docs/filters/opentsdb/clean_html.rb+16−0
@@ -0,0 +1,16 @@
1+module Docs
2+ class Opentsdb
3+ class CleanHtmlFilter < Filter
4+ def call
5+ # Reset the page scope to the body,
6+ # we needed the rest of the page for the entries filter.
7+ @doc = at_css(".documentwrapper > .bodywrapper > .body > .section")
8+
9+ # Remove table borders
10+ css('table').each { |table| table.delete 'border' }
11+
12+ doc
13+ end
14+ end
15+ end
16+end
lib/docs/filters/opentsdb/entries.rb+35−0
@@ -0,0 +1,35 @@
1+module Docs
2+ class Opentsdb
3+ class EntriesFilter < Docs::EntriesFilter
4+
5+ def get_name
6+ header = css(".section > h1").first
7+ return header.content.strip unless header.nil?
8+ end
9+
10+ def get_type
11+ return nil if breadcrumbs.length < 2
12+
13+ # This is time for a little bit of cheating
14+ return breadcrumbs[1] if breadcrumbs.include? "HTTP API"
15+
16+ breadcrumbs.last
17+ end
18+
19+ def additional_entries
20+ []
21+ end
22+
23+
24+ def breadcrumbs
25+ nav_links = css(".related").first.css("li")
26+ breadcrumbs = nav_links.reject do |node|
27+ node['class'] == "right"
28+ end
29+
30+ breadcrumbs.map { |node| node.at_css("a").content }
31+ .reject { |link| link.empty? }
32+ end
33+ end
34+ end
35+end
lib/docs/scrapers/opentsdb.rb+19−0
@@ -0,0 +1,19 @@
1+module Docs
2+ class Opentsdb < UrlScraper
3+ self.name = 'OpenTSDB'
4+ self.type = 'opentsdb'
5+ self.version = '2.1'
6+ self.base_url = 'http://opentsdb.net/docs/build/html/'
7+ self.root_path = 'index.html'
8+
9+ html_filters.push 'opentsdb/entries', 'opentsdb/clean_html'
10+
11+
12+ options[:skip] = %w(genindex.html search.html)
13+
14+
15+ options[:attribution] = <<-HTML
16+ &copy; 2015 OpenTSDB
17+ HTML
18+ end
19+end
public/icons/docs/opentsdb/16.png+0−0

Binary file not shown.

public/icons/docs/opentsdb/16@2x.png+0−0

Binary file not shown.