|
@@ -1,14 +1,20 @@
|
|
|
module Docs
|
|
module Docs
|
|
|
class Typescript < UrlScraper
|
|
class Typescript < UrlScraper
|
|
|
|
|
+ include MultipleBaseUrls
|
|
|
|
|
+
|
|
|
self.name = 'TypeScript'
|
|
self.name = 'TypeScript'
|
|
|
self.type = 'simple'
|
|
self.type = 'simple'
|
|
|
self.release = '4.1.3'
|
|
self.release = '4.1.3'
|
|
|
- self.base_url = 'https://www.typescriptlang.org/'
|
|
|
|
|
- self.root_path = 'docs/handbook/index.html'
|
|
|
|
|
- self.initial_paths = [
|
|
|
|
|
- 'tsconfig/'
|
|
|
|
|
|
|
+ self.base_urls = [
|
|
|
|
|
+ 'https://www.typescriptlang.org/docs/handbook/',
|
|
|
|
|
+ 'https://www.typescriptlang.org/'
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
|
|
+ def initial_urls
|
|
|
|
|
+ [ 'https://www.typescriptlang.org/docs/handbook/',
|
|
|
|
|
+ 'https://www.typescriptlang.org/tsconfig' ]
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
self.links = {
|
|
self.links = {
|
|
|
home: 'https://www.typescriptlang.org',
|
|
home: 'https://www.typescriptlang.org',
|
|
|
code: 'https://github.com/Microsoft/TypeScript'
|
|
code: 'https://github.com/Microsoft/TypeScript'
|
|
@@ -19,24 +25,15 @@ module Docs
|
|
|
options[:container] = 'main'
|
|
options[:container] = 'main'
|
|
|
|
|
|
|
|
options[:skip] = [
|
|
options[:skip] = [
|
|
|
- 'docs/handbook/react-&-webpack.html'
|
|
|
|
|
|
|
+ 'react-&-webpack.html'
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
options[:skip_patterns] = [
|
|
options[:skip_patterns] = [
|
|
|
/2/,
|
|
/2/,
|
|
|
- /release-notes/
|
|
|
|
|
|
|
+ /release-notes/,
|
|
|
|
|
+ /play\//
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
- options[:only_patterns] = [
|
|
|
|
|
- /docs\/handbook\//,
|
|
|
|
|
- /tsconfig\//
|
|
|
|
|
- ]
|
|
|
|
|
-
|
|
|
|
|
- options[:fix_urls] = -> (url) do
|
|
|
|
|
- url.gsub!(/docs\/handbook\/index.html/, "index.html")
|
|
|
|
|
- url
|
|
|
|
|
- end
|
|
|
|
|
-
|
|
|
|
|
options[:attribution] = <<-HTML
|
|
options[:attribution] = <<-HTML
|
|
|
© 2012-2020 Microsoft<br>
|
|
© 2012-2020 Microsoft<br>
|
|
|
Licensed under the Apache License, Version 2.0.
|
|
Licensed under the Apache License, Version 2.0.
|