History

Update Python documentation (3.4.2)

Fixes #137.

Thibaut committed 12 years ago

Commit 660cb1e1 parent e2a26c32 files · +6 −7Browse files

Unified · Split

2 files
  1. lib/docs/filters/python/entries.rb +5 −6
  2. lib/docs/scrapers/python.rb +1 −1
lib/docs/filters/python/entries.rb+5−6
@@ -16,7 +16,10 @@ module Docs · 15 unmodified lines
16 def get_name16 def get_name
17 name = at_css('h1').content17 name = at_css('h1').content
18 name.remove! %r{\A[\d\.]+ } # remove list number18 name.remove! %r{\A[\d\.]+ } # remove list number
19 name.remove! "\u{00B6}" # remove pilcrow sign
19 name.remove! %r{ [\u{2013}\u{2014}].+\z} # remove text after em/en dash20 name.remove! %r{ [\u{2013}\u{2014}].+\z} # remove text after em/en dash
21 name.remove! 'Built-in'
22 name.strip!
20 name23 name
21 end24 end
22 25
@@ -42,11 +45,11 @@ module Docs · 19 unmodified lines
42 end45 end
43 46
44 def include_default_entry?47 def include_default_entry?
45 name !~ /[A-Z]/ && !skip? # skip non-module names48 !at_css('.body > .section:only-child > .toctree-wrapper:last-child') && !type.in?(%w(Language Superseded))
46 end49 end
47 50
48 def additional_entries51 def additional_entries
49 return [] if root_page? || skip? || name == 'errno'52 return [] if root_page? || !include_default_entry? || name == 'errno'
50 clean_id_attributes53 clean_id_attributes
51 entries = []54 entries = []
52 55
@@ -67,10 +70,6 @@ module Docs · 14 unmodified lines
67 entries70 entries
68 end71 end
69 72
70 def skip?
71 type == 'Language'
72 end
73
74 def clean_id_attributes73 def clean_id_attributes
75 css('.section > .target[id]').each do |node|74 css('.section > .target[id]').each do |node|
76 if dt = node.at_css('+ dl > dt')75 if dt = node.at_css('+ dl > dt')
lib/docs/scrapers/python.rb+1−1
@@ -1,6 +1,6 @@
1module Docs1module Docs
2 class Python < FileScraper2 class Python < FileScraper
3 self.version = '3.4.0'3 self.version = '3.4.2'
4 self.type = 'sphinx'4 self.type = 'sphinx'
5 self.dir = '/Users/Thibaut/DevDocs/Docs/Python' # downloaded from docs.python.org/3/download.html5 self.dir = '/Users/Thibaut/DevDocs/Docs/Python' # downloaded from docs.python.org/3/download.html
6 self.base_url = 'http://docs.python.org/3/'6 self.base_url = 'http://docs.python.org/3/'