From f26e397660e47899a7ee500574a8e2e7cef4045f Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Sun, 12 Mar 2017 16:53:44 -0400 Subject: [PATCH] Update Matplotlib documentation (2.0.0) --- .../javascripts/templates/pages/about_tmpl.coffee | 2 +- lib/docs/filters/matplotlib/entries.rb | 13 ++++++++----- lib/docs/scrapers/matplotlib.rb | 11 ++++++++++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 781fb118..7d652bc7 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -346,7 +346,7 @@ credits = [ 'https://daringfireball.net/projects/markdown/license' ], [ 'Matplotlib', - '2012-2016 Matplotlib Development Team. All rights reserved.', + '2012-2017 Matplotlib Development Team. All rights reserved.', 'Custom', 'https://raw.githubusercontent.com/matplotlib/matplotlib/master/LICENSE/LICENSE' ], [ diff --git a/lib/docs/filters/matplotlib/entries.rb b/lib/docs/filters/matplotlib/entries.rb index f6ff7217..c8e60ed6 100644 --- a/lib/docs/filters/matplotlib/entries.rb +++ b/lib/docs/filters/matplotlib/entries.rb @@ -18,13 +18,16 @@ module Docs name.remove! 'mpl_toolkits.' name.remove! ' API' name.remove! %r{ \(.*\)} - name.downcase! name end def get_type return TYPE_BY_SLUG[slug] if TYPE_BY_SLUG.key?(slug) - name.split('.').first + type = name.split('.').first + type.downcase! + type.remove! ' module' + type.remove! ' class' + type end def additional_entries @@ -32,19 +35,19 @@ module Docs css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]').each do |node| entry_name = node['id'].remove('matplotlib.').remove('mpl_toolkits.') - entries << [entry_name, node['id']] + entries << [entry_name, node['id']] unless entry_name.casecmp(name) == 0 end css('.data > dt[id]').each do |node| if node['id'].split('.').last.upcase! # skip constants entry_name = node['id'].remove('matplotlib.').remove('mpl_toolkits.') - entries << [entry_name, node['id']] + entries << [entry_name, node['id']] unless entry_name.casecmp(name) == 0 end end css('.function > dt[id]', '.method > dt[id]', '.classmethod > dt[id]').each do |node| entry_name = node['id'].remove('matplotlib.').remove('mpl_toolkits.') - entries << [entry_name + '()', node['id']] + entries << [entry_name + '()', node['id']] unless entry_name.casecmp(name) == 0 end entries diff --git a/lib/docs/scrapers/matplotlib.rb b/lib/docs/scrapers/matplotlib.rb index 709f21bf..97c8f283 100644 --- a/lib/docs/scrapers/matplotlib.rb +++ b/lib/docs/scrapers/matplotlib.rb @@ -16,10 +16,19 @@ module Docs options[:skip] = %w(api_changes.html tutorial.html faq.html) options[:attribution] = <<-HTML - © 2012–2016 Matplotlib Development Team. All rights reserved.
+ © 2012–2017 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement. HTML + version '2.0' do + self.release = '2.0.0' + self.base_urls = [ + "http://matplotlib.org/#{release}/api/", + "http://matplotlib.org/#{release}/mpl_toolkits/mplot3d/", + "http://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/" + ] + end + version '1.5' do self.release = '1.5.3' self.base_urls = [