History

Add matplotlib documentation

lonewolf committed 10 years ago

Commit 8f881501 parent ab41f0c5 files · +65 −-2Browse files

Unified · Split

5 files
  1. lib/docs/filters/matplotlib/clean_html.rb +12 −0
  2. lib/docs/filters/matplotlib/entries.rb +31 −0
  3. lib/docs/scrapers/matplotlib.rb +24 −0
  4. public/icons/docs/matplotlib/16.png +0 −0
  5. public/icons/docs/matplotlib/16@2x.png +0 −0
lib/docs/filters/matplotlib/clean_html.rb+12−0
@@ -0,0 +1,12 @@
1module Docs
2 class Matplotlib
3 class CleanHtmlFilter < Filter
4 def call
5 css('.headerlink').each do |node|
6 node.remove
7 end
8 doc
9 end
10 end
11 end
12end
lib/docs/filters/matplotlib/entries.rb+31−0
@@ -0,0 +1,31 @@
1module Docs
2 class Matplotlib
3 class EntriesFilter < Docs::EntriesFilter
4 def get_name
5 name = at_css('h1').content.strip
6 name.remove! "\u{00b6}"
7 name
8 end
9
10 def get_type
11 name = at_css('h1').content.strip
12 name.remove! "\u{00b6}"
13 name
14 end
15
16 def additional_entries
17 entries = []
18 ents = css('dt .descname')
19
20 if ents
21 ents.each do |node|
22 name = node.content.sub(/\(.*\)/, '()')
23 id = node.parent['id']
24 entries << [name, id, get_name]
25 end
26 end
27 entries
28 end
29 end
30 end
31end
lib/docs/scrapers/matplotlib.rb+24−0
@@ -0,0 +1,24 @@
1module Docs
2 class Matplotlib < FileScraper
3 self.name = 'Matplotlib'
4 self.type = 'sphinx'
5 self.root_path = 'index.html'
6 self.release = "1.5.1"
7 self.links = {
8 home: 'http://matplotlib.org/',
9 code: 'https://github.com/matplotlib/matplotlib'
10 }
11
12 html_filters.push 'matplotlib/entries', 'matplotlib/clean_html'
13
14 options[:container] = '.body'
15
16 options[:attribution] = <<-HTML
17 &copy; Matplotlib Development Team <br>
18 Licensed under the BSD License.
19 HTML
20
21 self.dir = '~/workspace/tmp/matplotlib/matplotlib.github.com-master/1.5.1/api/'
22 # self.base_url = 'http://matplotlib.org/api/'
23 end
24end
public/icons/docs/matplotlib/16.png+0−0

Binary file not shown.

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

Binary file not shown.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t