History

Update Haskell documentation (7.10.2)

Thibaut committed 11 years ago

Commit b9a038d1 parent 0d496d62 files · +40 −30Browse files

Unified · Split

2 files
  1. lib/docs/filters/haskell/entries.rb +21 −15
  2. lib/docs/scrapers/haskell.rb +19 −15
lib/docs/filters/haskell/entries.rb+21−15
@@ -2,19 +2,25 @@ module Docs · 1 unmodified line
2 class Haskell2 class Haskell
3 class EntriesFilter < Docs::EntriesFilter3 class EntriesFilter < Docs::EntriesFilter
4 IGNORE_ENTRIES_PATHS = %w(4 IGNORE_ENTRIES_PATHS = %w(
5 bytestring-0.10.4.0/Data-ByteString-Lazy.html5 Data-ByteString-Lazy.html
6 bytestring-0.10.4.0/Data-ByteString-Char8.html6 Data-ByteString-Char8.html
7 bytestring-0.10.4.0/Data-ByteString-Lazy-Char8.html7 Data-ByteString-Lazy-Char8.html
8 array-0.5.0.0/Data-Array-IArray.html8 Data-Array-IArray.html
9 containers-0.5.5.1/Data-IntMap-Lazy.html9 Data-IntMap-Lazy.html
10 containers-0.5.5.1/Data-Map-Lazy.html10 Data-Map-Lazy.html
11 unix-2.7.0.1/System-Posix-Files-ByteString.html11 System-Posix-Files-ByteString.html
12 filepath-1.3.0.2/System-FilePath-Windows.html12 System-FilePath-Windows.html
13 transformers-0.3.0.0/Control-Monad-Trans-RWS-Lazy.html13 Control-Monad-Trans-RWS-Lazy.html
14 transformers-0.3.0.0/Control-Monad-Trans-Writer-Lazy.html14 Control-Monad-Trans-State-Lazy.html
15 base-4.7.0.0/GHC-Conc-Sync.html15 Control-Monad-Trans-Writer-Lazy.html
16 base-4.7.0.0/GHC-IO-Encoding-UTF32.html16 GHC-Conc-Sync.html
17 unix-2.7.0.1/System-Posix-Terminal-ByteString.html)17 GHC-OldList.html
18 GHC-IO-Encoding-UTF32.html
19 System-Posix-Terminal-ByteString.html
20 Text-XHtml-Frameset.html
21 Text-XHtml-Strict.html
22 System-Posix-Process-ByteString.html
23 Data-ByteString-Builder-Prim.html)
18 24
19 def get_name25 def get_name
20 at_css('#module-header .caption').content.strip26 at_css('#module-header .caption').content.strip
@@ -33,7 +39,7 @@ module Docs · 12 unmodified lines
33 end39 end
34 40
35 def additional_entries41 def additional_entries
36 return [] if IGNORE_ENTRIES_PATHS.include?(subpath)42 return [] if IGNORE_ENTRIES_PATHS.include?(subpath.split('/').last)
37 43
38 css('#synopsis > ul > li').each_with_object [] do |node, entries|44 css('#synopsis > ul > li').each_with_object [] do |node, entries|
39 link = node.at_css('a')45 link = node.at_css('a')
@@ -41,7 +47,7 @@ module Docs · 1 unmodified line
41 name = node.content.strip47 name = node.content.strip
42 name.remove! %r{\A(?:module|data|newtype|class|type family m|type)\s+}48 name.remove! %r{\A(?:module|data|newtype|class|type family m|type)\s+}
43 name.sub! %r{\A\((.+?)\)}, '\1'49 name.sub! %r{\A\((.+?)\)}, '\1'
44 name.sub!(/ (?:\:\: (\w+))?.+\z/) { |_| $1 ? " (#{$1})" : '' }50 name.sub!(/ (?:\:\: (\w+))?.*\z/) { |_| $1 ? " (#{$1})" : '' }
45 next if name == self.name51 next if name == self.name
46 entries << [name, link['href'].remove('#')]52 entries << [name, link['href'].remove('#')]
47 end53 end
lib/docs/scrapers/haskell.rb+19−15
@@ -2,27 +2,31 @@ module Docs · 1 unmodified line
2 class Haskell < UrlScraper2 class Haskell < UrlScraper
3 self.name = 'Haskell'3 self.name = 'Haskell'
4 self.type = 'haskell'4 self.type = 'haskell'
5 self.version = '7.8.4'5 self.version = '7.10.2'
6 self.base_url = 'https://downloads.haskell.org/~ghc/7.8.4/docs/html/libraries/'6 self.base_url = "https://downloads.haskell.org/~ghc/#{version}/docs/html/libraries/"
7 self.root_path = 'index.html'7 self.root_path = 'index.html'
8 8
9 html_filters.push 'haskell/entries', 'haskell/clean_html'9 html_filters.push 'haskell/entries', 'haskell/clean_html'
10 10
11 options[:container] = '#content'11 options[:container] = '#content'
12 12
13 options[:skip] = %w(13 options[:skip_patterns] = [
14 hoopl-3.10.0.1/Compiler-Hoopl-Internals.html14 /src\//,
15 base-4.7.0.0/Control-Exception-Base.html15 /doc-index/,
16 binary-0.7.1.0/Data-Binary-Get-Internal.html16 /haskell2010/,
17 template-haskell-2.9.0.0/Language-Haskell-TH-Lib.html17 /ghc-/,
18 haskell98-2.0.0.3/Prelude.html18 /Cabal-/,
19 pretty-1.1.1.1/Text-PrettyPrint.html19 /Compiler-Hoopl-Internals\.html\z/i,
20 base-4.7.0.0/Data-OldTypeable-Internal.html20 /Control-Exception-Base\.html\z/i,
21 base-4.7.0.0/Data-Typeable-Internal.html21 /Data-Binary-Get-Internal\.html\z/i,
22 base-4.7.0.0/GHC-IO-Encoding-Types.html22 /Language-Haskell-TH-Lib\.html\z/i,
23 unix-2.7.0.1/System-Posix-Process-Internals.html)23 /Prelude\.html\z/i,
24 24 /Text-PrettyPrint\.html\z/i,
25 options[:skip_patterns] = [/src\//, /doc-index/, /haskell2010/, /ghc-/, /Cabal-/]25 /Data-OldTypeable-Internal\.html\z/i,
26 /Data-Typeable-Internal\.html\z/i,
27 /GHC-IO-Encoding-Types\.html\z/i,
28 /System-Posix-Process-Internals\.html\z/i
29 ]
26 30
27 options[:attribution] = <<-HTML31 options[:attribution] = <<-HTML
28 &copy; The University of Glasgow and others<br>32 &copy; The University of Glasgow and others<br>