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
1616 def get_name
1717 name = at_css('h1').content
1818 name.remove! %r{\A[\d\.]+ } # remove list number
19+ name.remove! "\u{00B6}" # remove pilcrow sign
1920 name.remove! %r{ [\u{2013}\u{2014}].+\z} # remove text after em/en dash
21+ name.remove! 'Built-in'
22+ name.strip!
2023 name
2124 end
2225
@@ -42,11 +45,11 @@ module Docs · 19 unmodified lines
4245 end
4346
4447 def include_default_entry?
45− name !~ /[A-Z]/ && !skip? # skip non-module names
48+ !at_css('.body > .section:only-child > .toctree-wrapper:last-child') && !type.in?(%w(Language Superseded))
4649 end
4750
4851 def additional_entries
49− return [] if root_page? || skip? || name == 'errno'
52+ return [] if root_page? || !include_default_entry? || name == 'errno'
5053 clean_id_attributes
5154 entries = []
5255
@@ -67,10 +70,6 @@ module Docs · 14 unmodified lines
6770 entries
6871 end
6972
70− def skip?
71− type == 'Language'
72− end
73−
7473 def clean_id_attributes
7574 css('.section > .target[id]').each do |node|
7675 if dt = node.at_css('+ dl > dt')
lib/docs/scrapers/python.rb+1−1
@@ -1,6 +1,6 @@
11 module Docs
22 class Python < FileScraper
3− self.version = '3.4.0'
3+ self.version = '3.4.2'
44 self.type = 'sphinx'
55 self.dir = '/Users/Thibaut/DevDocs/Docs/Python' # downloaded from docs.python.org/3/download.html
66 self.base_url = 'http://docs.python.org/3/'