History

Matplotlib toolkits support

japborst committed 9 years ago

Commit 718fa991 parent 79a20252 files · +16 −5Browse files

Showing the changes to lib/docs/filters/matplotlib (1 of 2 files). Show all

Unified · Split

lib/docs/filters/matplotlib/entries.rb+8−3
@@ -15,6 +15,8 @@ module Docs · 14 unmodified lines
1515 name = at_css('h1').content.strip
1616 name.remove! "\u{00b6}"
1717 name.remove! 'matplotlib.'
18+ name.remove! 'mpl_toolkits.'
19+ name.remove! ' API'
1820 name.remove! %r{ \(.*\)}
1921 name.downcase!
2022 name
@@ -29,17 +31,20 @@ module Docs · 8 unmodified lines
2931 entries = []
3032
3133 css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]').each do |node|
32− entries << [node['id'].remove('matplotlib.'), node['id']]
34+ entry_name = node['id'].remove('matplotlib.').remove('mpl_toolkits.')
35+ entries << [entry_name, node['id']]
3336 end
3437
3538 css('.data > dt[id]').each do |node|
3639 if node['id'].split('.').last.upcase! # skip constants
37− entries << [node['id'].remove('matplotlib.'), node['id']]
40+ entry_name = node['id'].remove('matplotlib.').remove('mpl_toolkits.')
41+ entries << [entry_name, node['id']]
3842 end
3943 end
4044
4145 css('.function > dt[id]', '.method > dt[id]', '.classmethod > dt[id]').each do |node|
42− entries << [node['id'].remove('matplotlib.') + '()', node['id']]
46+ entry_name = node['id'].remove('matplotlib.').remove('mpl_toolkits.')
47+ entries << [entry_name + '()', node['id']]
4348 end
4449
4550 entries