| @@ -18,13 +18,16 @@ module Docs · 17 unmodified lines |
| 18 | name.remove! 'mpl_toolkits.' | 18 | name.remove! 'mpl_toolkits.' |
| 19 | name.remove! ' API' | 19 | name.remove! ' API' |
| 20 | name.remove! %r{ \(.*\)} | 20 | name.remove! %r{ \(.*\)} |
| 21 | name.downcase! | | |
| 22 | name | 21 | name |
| 23 | end | 22 | end |
| 24 | | 23 | |
| 25 | def get_type | 24 | def get_type |
| 26 | return TYPE_BY_SLUG[slug] if TYPE_BY_SLUG.key?(slug) | 25 | return TYPE_BY_SLUG[slug] if TYPE_BY_SLUG.key?(slug) |
| 27 | name.split('.').first | 26 | type = name.split('.').first |
| | 27 | type.downcase! |
| | 28 | type.remove! ' module' |
| | 29 | type.remove! ' class' |
| | 30 | type |
| 28 | end | 31 | end |
| 29 | | 32 | |
| 30 | def additional_entries | 33 | def additional_entries |
| @@ -32,19 +35,19 @@ module Docs · 1 unmodified line |
| 32 | | 35 | |
| 33 | css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]').each do |node| | 36 | css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]').each do |node| |
| 34 | entry_name = node['id'].remove('matplotlib.').remove('mpl_toolkits.') | 37 | entry_name = node['id'].remove('matplotlib.').remove('mpl_toolkits.') |
| 35 | entries << [entry_name, node['id']] | 38 | entries << [entry_name, node['id']] unless entry_name.casecmp(name) == 0 |
| 36 | end | 39 | end |
| 37 | | 40 | |
| 38 | css('.data > dt[id]').each do |node| | 41 | css('.data > dt[id]').each do |node| |
| 39 | if node['id'].split('.').last.upcase! # skip constants | 42 | if node['id'].split('.').last.upcase! # skip constants |
| 40 | entry_name = node['id'].remove('matplotlib.').remove('mpl_toolkits.') | 43 | entry_name = node['id'].remove('matplotlib.').remove('mpl_toolkits.') |
| 41 | entries << [entry_name, node['id']] | 44 | entries << [entry_name, node['id']] unless entry_name.casecmp(name) == 0 |
| 42 | end | 45 | end |
| 43 | end | 46 | end |
| 44 | | 47 | |
| 45 | css('.function > dt[id]', '.method > dt[id]', '.classmethod > dt[id]').each do |node| | 48 | css('.function > dt[id]', '.method > dt[id]', '.classmethod > dt[id]').each do |node| |
| 46 | entry_name = node['id'].remove('matplotlib.').remove('mpl_toolkits.') | 49 | entry_name = node['id'].remove('matplotlib.').remove('mpl_toolkits.') |
| 47 | entries << [entry_name + '()', node['id']] | 50 | entries << [entry_name + '()', node['id']] unless entry_name.casecmp(name) == 0 |
| 48 | end | 51 | end |
| 49 | | 52 | |
| 50 | entries | 53 | entries |