Showing the changes to lib/docs (2 of 2 files). Show all
Unified · Split
| @@ -15,6 +15,8 @@ module Docs · 14 unmodified lines | |||
| 15 | name = at_css('h1').content.strip | 15 | name = at_css('h1').content.strip |
| 16 | name.remove! "\u{00b6}" | 16 | name.remove! "\u{00b6}" |
| 17 | name.remove! 'matplotlib.' | 17 | name.remove! 'matplotlib.' |
| 18 | name.remove! 'mpl_toolkits.' | ||
| 19 | name.remove! ' API' | ||
| 18 | name.remove! %r{ \(.*\)} | 20 | name.remove! %r{ \(.*\)} |
| 19 | name.downcase! | 21 | name.downcase! |
| 20 | name | 22 | name |
| @@ -29,17 +31,20 @@ module Docs · 8 unmodified lines | |||
| 29 | entries = [] | 31 | entries = [] |
| 30 | 32 | ||
| 31 | css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]').each do |node| | 33 | 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']] | ||
| 33 | end | 36 | end |
| 34 | 37 | ||
| 35 | css('.data > dt[id]').each do |node| | 38 | css('.data > dt[id]').each do |node| |
| 36 | if node['id'].split('.').last.upcase! # skip constants | 39 | 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']] | ||
| 38 | end | 42 | end |
| 39 | end | 43 | end |
| 40 | 44 | ||
| 41 | css('.function > dt[id]', '.method > dt[id]', '.classmethod > dt[id]').each do |node| | 45 | 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']] | ||
| 43 | end | 48 | end |
| 44 | 49 | ||
| 45 | entries | 50 | entries |
| @@ -1,5 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Matplotlib < UrlScraper | 2 | class Matplotlib < UrlScraper |
| 3 | include MultipleBaseUrls | ||
| 4 | |||
| 3 | self.name = 'Matplotlib' | 5 | self.name = 'Matplotlib' |
| 4 | self.type = 'sphinx' | 6 | self.type = 'sphinx' |
| 5 | self.root_path = 'index.html' | 7 | self.root_path = 'index.html' |
| @@ -11,7 +13,7 @@ module Docs · 5 unmodified lines | |||
| 11 | html_filters.push 'matplotlib/entries', 'sphinx/clean_html' | 13 | html_filters.push 'matplotlib/entries', 'sphinx/clean_html' |
| 12 | 14 | ||
| 13 | options[:container] = '.body' | 15 | options[:container] = '.body' |
| 14 | options[:skip] = %w(api_changes.html) | 16 | options[:skip] = %w(api_changes.html tutorial.html faq.html) |
| 15 | 17 | ||
| 16 | options[:attribution] = <<-HTML | 18 | options[:attribution] = <<-HTML |
| 17 | © 2012–2016 Matplotlib Development Team. All rights reserved.<br> | 19 | © 2012–2016 Matplotlib Development Team. All rights reserved.<br> |
| @@ -20,7 +22,11 @@ module Docs · 2 unmodified lines | |||
| 20 | 22 | ||
| 21 | version '1.5' do | 23 | version '1.5' do |
| 22 | self.release = '1.5.1' | 24 | self.release = '1.5.1' |
| 23 | self.base_url = 'http://matplotlib.org/1.5.1/api/' | 25 | self.base_urls = [ |
| 26 | 'http://matplotlib.org/1.5.1/api/', | ||
| 27 | 'http://matplotlib.org/1.5.1/mpl_toolkits/mplot3d/', | ||
| 28 | 'http://matplotlib.org/1.5.1/mpl_toolkits/axes_grid/api/' | ||
| 29 | ] | ||
| 24 | end | 30 | end |
| 25 | end | 31 | end |
| 26 | end | 32 | end |