diff --git a/lib/docs/filters/matplotlib/entries.rb b/lib/docs/filters/matplotlib/entries.rb index 9e789c98..f6ff7217 100644 --- a/lib/docs/filters/matplotlib/entries.rb +++ b/lib/docs/filters/matplotlib/entries.rb @@ -15,6 +15,8 @@ module Docs name = at_css('h1').content.strip name.remove! "\u{00b6}" name.remove! 'matplotlib.' + name.remove! 'mpl_toolkits.' + name.remove! ' API' name.remove! %r{ \(.*\)} name.downcase! name @@ -29,17 +31,20 @@ module Docs entries = [] 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 css('.data > dt[id]').each do |node| 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 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 entries diff --git a/lib/docs/scrapers/matplotlib.rb b/lib/docs/scrapers/matplotlib.rb index e32fb3ab..56f15bc8 100644 --- a/lib/docs/scrapers/matplotlib.rb +++ b/lib/docs/scrapers/matplotlib.rb @@ -1,5 +1,7 @@ module Docs class Matplotlib < UrlScraper + include MultipleBaseUrls + self.name = 'Matplotlib' self.type = 'sphinx' self.root_path = 'index.html' @@ -11,7 +13,7 @@ module Docs html_filters.push 'matplotlib/entries', 'sphinx/clean_html' options[:container] = '.body' - options[:skip] = %w(api_changes.html) + options[:skip] = %w(api_changes.html tutorial.html faq.html) options[:attribution] = <<-HTML © 2012–2016 Matplotlib Development Team. All rights reserved.
@@ -20,7 +22,11 @@ module Docs version '1.5' do 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