mirror of https://github.com/freeCodeCamp/devdocs
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
|
||||
© 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
|
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.9 KiB |
Loading…
Reference in new issue