-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
Copy pathtypescript.rb
64 lines (51 loc) · 1.46 KB
/
typescript.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
module Docs
class Typescript < UrlScraper
include MultipleBaseUrls
self.name = 'TypeScript'
self.type = 'typescript'
self.root_path = 'docs/'
def initial_urls
[ 'https://www.typescriptlang.org/docs/handbook/',
'https://www.typescriptlang.org/tsconfig' ]
end
self.links = {
home: 'https://www.typescriptlang.org',
code: 'https://github.com/Microsoft/TypeScript'
}
html_filters.push 'typescript/entries', 'typescript/clean_html', 'title'
options[:fix_urls_before_parse] = ->(url) do
url.sub! '/docs/handbook/esm-node.html', '/docs/handbook/modules/reference.html#node16-nodenext'
url.sub! '/docs/handbook/modules.html', '/docs/handbook/modules/introduction.html'
url
end
options[:skip] = [
'react-&-webpack.html'
]
options[:skip_patterns] = [
/\Abranding/,
/\Acommunity/,
/\Adocs\Z/,
/\Atools/,
/release-notes/,
/dt\/search/,
/play/
]
options[:attribution] = <<-HTML
© 2012-2024 Microsoft<br>
Licensed under the Apache License, Version 2.0.
HTML
version do
self.release = '5.7.2'
self.base_urls = [
'https://www.typescriptlang.org/docs/handbook/',
'https://www.typescriptlang.org/'
]
end
version '5.1' do
self.release = '5.1.3'
end
def get_latest_version(opts)
get_latest_github_release('Microsoft', 'TypeScript', opts)
end
end
end