Unified · Split
| @@ -0,0 +1,12 @@ | |||
| 1 | module 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 | ||
| 12 | end | ||
| @@ -0,0 +1,31 @@ | |||
| 1 | module 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 | ||
| 31 | end | ||
| @@ -0,0 +1,24 @@ | |||
| 1 | module 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 | © 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 | ||
| 24 | end | ||
Binary file not shown.
Binary file not shown.