Update Haskell documentation (7.10.2)

pull/241/head
Thibaut 10 years ago
parent 0d496d63c8
commit b9a038d665

@ -2,19 +2,25 @@ module Docs
class Haskell class Haskell
class EntriesFilter < Docs::EntriesFilter class EntriesFilter < Docs::EntriesFilter
IGNORE_ENTRIES_PATHS = %w( IGNORE_ENTRIES_PATHS = %w(
bytestring-0.10.4.0/Data-ByteString-Lazy.html Data-ByteString-Lazy.html
bytestring-0.10.4.0/Data-ByteString-Char8.html Data-ByteString-Char8.html
bytestring-0.10.4.0/Data-ByteString-Lazy-Char8.html Data-ByteString-Lazy-Char8.html
array-0.5.0.0/Data-Array-IArray.html Data-Array-IArray.html
containers-0.5.5.1/Data-IntMap-Lazy.html Data-IntMap-Lazy.html
containers-0.5.5.1/Data-Map-Lazy.html Data-Map-Lazy.html
unix-2.7.0.1/System-Posix-Files-ByteString.html System-Posix-Files-ByteString.html
filepath-1.3.0.2/System-FilePath-Windows.html System-FilePath-Windows.html
transformers-0.3.0.0/Control-Monad-Trans-RWS-Lazy.html Control-Monad-Trans-RWS-Lazy.html
transformers-0.3.0.0/Control-Monad-Trans-Writer-Lazy.html Control-Monad-Trans-State-Lazy.html
base-4.7.0.0/GHC-Conc-Sync.html Control-Monad-Trans-Writer-Lazy.html
base-4.7.0.0/GHC-IO-Encoding-UTF32.html GHC-Conc-Sync.html
unix-2.7.0.1/System-Posix-Terminal-ByteString.html) GHC-OldList.html
GHC-IO-Encoding-UTF32.html
System-Posix-Terminal-ByteString.html
Text-XHtml-Frameset.html
Text-XHtml-Strict.html
System-Posix-Process-ByteString.html
Data-ByteString-Builder-Prim.html)
def get_name def get_name
at_css('#module-header .caption').content.strip at_css('#module-header .caption').content.strip
@ -33,7 +39,7 @@ module Docs
end end
def additional_entries def additional_entries
return [] if IGNORE_ENTRIES_PATHS.include?(subpath) return [] if IGNORE_ENTRIES_PATHS.include?(subpath.split('/').last)
css('#synopsis > ul > li').each_with_object [] do |node, entries| css('#synopsis > ul > li').each_with_object [] do |node, entries|
link = node.at_css('a') link = node.at_css('a')
@ -41,7 +47,7 @@ module Docs
name = node.content.strip name = node.content.strip
name.remove! %r{\A(?:module|data|newtype|class|type family m|type)\s+} name.remove! %r{\A(?:module|data|newtype|class|type family m|type)\s+}
name.sub! %r{\A\((.+?)\)}, '\1' name.sub! %r{\A\((.+?)\)}, '\1'
name.sub!(/ (?:\:\: (\w+))?.+\z/) { |_| $1 ? " (#{$1})" : '' } name.sub!(/ (?:\:\: (\w+))?.*\z/) { |_| $1 ? " (#{$1})" : '' }
next if name == self.name next if name == self.name
entries << [name, link['href'].remove('#')] entries << [name, link['href'].remove('#')]
end end

@ -2,27 +2,31 @@ module Docs
class Haskell < UrlScraper class Haskell < UrlScraper
self.name = 'Haskell' self.name = 'Haskell'
self.type = 'haskell' self.type = 'haskell'
self.version = '7.8.4' self.version = '7.10.2'
self.base_url = 'https://downloads.haskell.org/~ghc/7.8.4/docs/html/libraries/' self.base_url = "https://downloads.haskell.org/~ghc/#{version}/docs/html/libraries/"
self.root_path = 'index.html' self.root_path = 'index.html'
html_filters.push 'haskell/entries', 'haskell/clean_html' html_filters.push 'haskell/entries', 'haskell/clean_html'
options[:container] = '#content' options[:container] = '#content'
options[:skip] = %w( options[:skip_patterns] = [
hoopl-3.10.0.1/Compiler-Hoopl-Internals.html /src\//,
base-4.7.0.0/Control-Exception-Base.html /doc-index/,
binary-0.7.1.0/Data-Binary-Get-Internal.html /haskell2010/,
template-haskell-2.9.0.0/Language-Haskell-TH-Lib.html /ghc-/,
haskell98-2.0.0.3/Prelude.html /Cabal-/,
pretty-1.1.1.1/Text-PrettyPrint.html /Compiler-Hoopl-Internals\.html\z/i,
base-4.7.0.0/Data-OldTypeable-Internal.html /Control-Exception-Base\.html\z/i,
base-4.7.0.0/Data-Typeable-Internal.html /Data-Binary-Get-Internal\.html\z/i,
base-4.7.0.0/GHC-IO-Encoding-Types.html /Language-Haskell-TH-Lib\.html\z/i,
unix-2.7.0.1/System-Posix-Process-Internals.html) /Prelude\.html\z/i,
/Text-PrettyPrint\.html\z/i,
options[:skip_patterns] = [/src\//, /doc-index/, /haskell2010/, /ghc-/, /Cabal-/] /Data-OldTypeable-Internal\.html\z/i,
/Data-Typeable-Internal\.html\z/i,
/GHC-IO-Encoding-Types\.html\z/i,
/System-Posix-Process-Internals\.html\z/i
]
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; The University of Glasgow and others<br> &copy; The University of Glasgow and others<br>

Loading…
Cancel
Save