|
@@ -2,15 +2,17 @@ module Docs
|
|
|
class Haskell < UrlScraper
|
|
class Haskell < UrlScraper
|
|
|
self.name = 'Haskell'
|
|
self.name = 'Haskell'
|
|
|
self.type = 'haskell'
|
|
self.type = 'haskell'
|
|
|
- self.release = '7.10.3'
|
|
|
|
|
- self.base_url = "https://downloads.haskell.org/~ghc/#{release}/docs/html/libraries/"
|
|
|
|
|
- self.root_path = 'index.html'
|
|
|
|
|
|
|
+ self.root_path = 'users_guide/index.html'
|
|
|
|
|
+ self.initial_paths = %w(libraries/index.html)
|
|
|
|
|
|
|
|
html_filters.push 'haskell/entries', 'haskell/clean_html'
|
|
html_filters.push 'haskell/entries', 'haskell/clean_html'
|
|
|
|
|
|
|
|
- options[:container] = '#content'
|
|
|
|
|
|
|
+ options[:container] = ->(filter) { filter.subpath.start_with?('users_guide') ? '.body' : '#content' }
|
|
|
|
|
|
|
|
|
|
+ options[:only_patterns] = [/\Alibraries\//, /\Ausers_guide\//]
|
|
|
options[:skip_patterns] = [
|
|
options[:skip_patterns] = [
|
|
|
|
|
+ /-notes/,
|
|
|
|
|
+ /editing-guide/,
|
|
|
/src\//,
|
|
/src\//,
|
|
|
/doc-index/,
|
|
/doc-index/,
|
|
|
/haskell2010/,
|
|
/haskell2010/,
|
|
@@ -26,10 +28,37 @@ module Docs
|
|
|
/GHC-IO-Encoding-Types\.html\z/i,
|
|
/GHC-IO-Encoding-Types\.html\z/i,
|
|
|
/System-Posix-Process-Internals\.html\z/i
|
|
/System-Posix-Process-Internals\.html\z/i
|
|
|
]
|
|
]
|
|
|
|
|
+ options[:skip] = %w(
|
|
|
|
|
+ users_guide/license.html
|
|
|
|
|
+ users_guide/genindex.html
|
|
|
|
|
+ users_guide/search.html
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
- options[:attribution] = <<-HTML
|
|
|
|
|
- © The University of Glasgow and others<br>
|
|
|
|
|
- Licensed under a BSD-style license (see top of the page).
|
|
|
|
|
- HTML
|
|
|
|
|
|
|
+ options[:attribution] = ->(filter) do
|
|
|
|
|
+ if filter.subpath.start_with?('users_guide')
|
|
|
|
|
+ <<-HTML
|
|
|
|
|
+ © 2002–2007 The University Court of the University of Glasgow. All rights reserved.<br>
|
|
|
|
|
+ Licensed under the Glasgow Haskell Compiler License.
|
|
|
|
|
+ HTML
|
|
|
|
|
+ else
|
|
|
|
|
+ <<-HTML
|
|
|
|
|
+ © The University of Glasgow and others<br>
|
|
|
|
|
+ Licensed under a BSD-style license (see top of the page).
|
|
|
|
|
+ HTML
|
|
|
|
|
+ end
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ version '8' do
|
|
|
|
|
+ self.release = '8.0.1'
|
|
|
|
|
+ self.base_url = "https://downloads.haskell.org/~ghc/#{release}/docs/html/"
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ version '7' do
|
|
|
|
|
+ self.release = '7.10.3'
|
|
|
|
|
+ self.base_url = "https://downloads.haskell.org/~ghc/#{release}/docs/html/"
|
|
|
|
|
+ self.root_path = 'libraries/index.html'
|
|
|
|
|
+
|
|
|
|
|
+ options[:only_patterns] = [/\Alibraries\//]
|
|
|
|
|
+ end
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|