Add matplotlib documentation

pull/438/head
lonewolf 9 years ago committed by Thibaut Courouble
parent ab41f0c0ca
commit 8f88150d73

@ -0,0 +1,12 @@
module Docs
class Matplotlib
class CleanHtmlFilter < Filter
def call
css('.headerlink').each do |node|
node.remove
end
doc
end
end
end
end

@ -0,0 +1,31 @@
module Docs
class Matplotlib
class EntriesFilter < Docs::EntriesFilter
def get_name
name = at_css('h1').content.strip
name.remove! "\u{00b6}"
name
end
def get_type
name = at_css('h1').content.strip
name.remove! "\u{00b6}"
name
end
def additional_entries
entries = []
ents = css('dt .descname')
if ents
ents.each do |node|
name = node.content.sub(/\(.*\)/, '()')
id = node.parent['id']
entries << [name, id, get_name]
end
end
entries
end
end
end
end

@ -0,0 +1,24 @@
module Docs
class Matplotlib < FileScraper
self.name = 'Matplotlib'
self.type = 'sphinx'
self.root_path = 'index.html'
self.release = "1.5.1"
self.links = {
home: 'http://matplotlib.org/',
code: 'https://github.com/matplotlib/matplotlib'
}
html_filters.push 'matplotlib/entries', 'matplotlib/clean_html'
options[:container] = '.body'
options[:attribution] = <<-HTML
&copy; Matplotlib Development Team <br>
Licensed under the BSD License.
HTML
self.dir = '~/workspace/tmp/matplotlib/matplotlib.github.com-master/1.5.1/api/'
# self.base_url = 'http://matplotlib.org/api/'
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Loading…
Cancel
Save