Matplotlib toolkits support

pull/565/head
japborst 8 years ago committed by Thibaut Courouble
parent 79a2025dde
commit 718fa99961

@ -15,6 +15,8 @@ module Docs
name = at_css('h1').content.strip name = at_css('h1').content.strip
name.remove! "\u{00b6}" name.remove! "\u{00b6}"
name.remove! 'matplotlib.' name.remove! 'matplotlib.'
name.remove! 'mpl_toolkits.'
name.remove! ' API'
name.remove! %r{ \(.*\)} name.remove! %r{ \(.*\)}
name.downcase! name.downcase!
name name
@ -29,17 +31,20 @@ module Docs
entries = [] entries = []
css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]').each do |node| css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]').each do |node|
entries << [node['id'].remove('matplotlib.'), node['id']] entry_name = node['id'].remove('matplotlib.').remove('mpl_toolkits.')
entries << [entry_name, node['id']]
end end
css('.data > dt[id]').each do |node| css('.data > dt[id]').each do |node|
if node['id'].split('.').last.upcase! # skip constants if node['id'].split('.').last.upcase! # skip constants
entries << [node['id'].remove('matplotlib.'), node['id']] entry_name = node['id'].remove('matplotlib.').remove('mpl_toolkits.')
entries << [entry_name, node['id']]
end end
end end
css('.function > dt[id]', '.method > dt[id]', '.classmethod > dt[id]').each do |node| css('.function > dt[id]', '.method > dt[id]', '.classmethod > dt[id]').each do |node|
entries << [node['id'].remove('matplotlib.') + '()', node['id']] entry_name = node['id'].remove('matplotlib.').remove('mpl_toolkits.')
entries << [entry_name + '()', node['id']]
end end
entries entries

@ -1,5 +1,7 @@
module Docs module Docs
class Matplotlib < UrlScraper class Matplotlib < UrlScraper
include MultipleBaseUrls
self.name = 'Matplotlib' self.name = 'Matplotlib'
self.type = 'sphinx' self.type = 'sphinx'
self.root_path = 'index.html' self.root_path = 'index.html'
@ -11,7 +13,7 @@ module Docs
html_filters.push 'matplotlib/entries', 'sphinx/clean_html' html_filters.push 'matplotlib/entries', 'sphinx/clean_html'
options[:container] = '.body' options[:container] = '.body'
options[:skip] = %w(api_changes.html) options[:skip] = %w(api_changes.html tutorial.html faq.html)
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2012&ndash;2016 Matplotlib Development Team. All rights reserved.<br> &copy; 2012&ndash;2016 Matplotlib Development Team. All rights reserved.<br>
@ -20,7 +22,11 @@ module Docs
version '1.5' do version '1.5' do
self.release = '1.5.1' self.release = '1.5.1'
self.base_url = 'http://matplotlib.org/1.5.1/api/' self.base_urls = [
'http://matplotlib.org/1.5.1/api/',
'http://matplotlib.org/1.5.1/mpl_toolkits/mplot3d/',
'http://matplotlib.org/1.5.1/mpl_toolkits/axes_grid/api/'
]
end end
end end
end end

Loading…
Cancel
Save