diff --git a/lib/docs/filters/matplotlib/clean_html.rb b/lib/docs/filters/matplotlib/clean_html.rb new file mode 100644 index 00000000..5c16605a --- /dev/null +++ b/lib/docs/filters/matplotlib/clean_html.rb @@ -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 diff --git a/lib/docs/filters/matplotlib/entries.rb b/lib/docs/filters/matplotlib/entries.rb new file mode 100644 index 00000000..0bf3a53b --- /dev/null +++ b/lib/docs/filters/matplotlib/entries.rb @@ -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 diff --git a/lib/docs/scrapers/matplotlib.rb b/lib/docs/scrapers/matplotlib.rb new file mode 100644 index 00000000..916fd50c --- /dev/null +++ b/lib/docs/scrapers/matplotlib.rb @@ -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
+ 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 diff --git a/public/icons/docs/matplotlib/16.png b/public/icons/docs/matplotlib/16.png new file mode 100644 index 00000000..8875fbce Binary files /dev/null and b/public/icons/docs/matplotlib/16.png differ diff --git a/public/icons/docs/matplotlib/16@2x.png b/public/icons/docs/matplotlib/16@2x.png new file mode 100644 index 00000000..8af81757 Binary files /dev/null and b/public/icons/docs/matplotlib/16@2x.png differ