| @@ -2,9 +2,13 @@ module Docs · 1 unmodified line |
| 2 | class Typescript < UrlScraper | 2 | class Typescript < UrlScraper |
| 3 | self.name = 'TypeScript' | 3 | self.name = 'TypeScript' |
| 4 | self.type = 'simple' | 4 | self.type = 'simple' |
| 5 | self.release = '4.1.2' | 5 | self.release = '4.1.3' |
| 6 | self.base_url = 'https://www.typescriptlang.org/docs/handbook/' | 6 | self.base_url = 'https://www.typescriptlang.org/' |
| 7 | self.root_path = 'index.html' | 7 | self.root_path = 'docs/handbook/index.html' |
| | 8 | self.initial_paths = [ |
| | 9 | 'tsconfig/' |
| | 10 | ] |
| | 11 | |
| 8 | self.links = { | 12 | self.links = { |
| 9 | home: 'https://www.typescriptlang.org', | 13 | home: 'https://www.typescriptlang.org', |
| 10 | code: 'https://github.com/Microsoft/TypeScript' | 14 | code: 'https://github.com/Microsoft/TypeScript' |
| @@ -15,14 +19,24 @@ module Docs · 4 unmodified lines |
| 15 | options[:container] = 'main' | 19 | options[:container] = 'main' |
| 16 | | 20 | |
| 17 | options[:skip] = [ | 21 | options[:skip] = [ |
| 18 | 'react-&-webpack.html', | 22 | 'docs/handbook/react-&-webpack.html' |
| 19 | ] | 23 | ] |
| 20 | | 24 | |
| 21 | options[:skip_patterns] = [ | 25 | options[:skip_patterns] = [ |
| 22 | /2/, | 26 | /2/, |
| 23 | /release-notes/, | 27 | /release-notes/ |
| | 28 | ] |
| | 29 | |
| | 30 | options[:only_patterns] = [ |
| | 31 | /docs\/handbook\//, |
| | 32 | /tsconfig\// |
| 24 | ] | 33 | ] |
| 25 | | 34 | |
| | 35 | options[:fix_urls] = -> (url) do |
| | 36 | url.gsub!(/docs\/handbook\/index.html/, "index.html") |
| | 37 | url |
| | 38 | end |
| | 39 | |
| 26 | options[:attribution] = <<-HTML | 40 | options[:attribution] = <<-HTML |
| 27 | © 2012-2020 Microsoft<br> | 41 | © 2012-2020 Microsoft<br> |
| 28 | Licensed under the Apache License, Version 2.0. | 42 | Licensed under the Apache License, Version 2.0. |
| @@ -31,5 +45,6 @@ module Docs · 2 unmodified lines |
| 31 | def get_latest_version(opts) | 45 | def get_latest_version(opts) |
| 32 | get_latest_github_release('Microsoft', 'TypeScript', opts) | 46 | get_latest_github_release('Microsoft', 'TypeScript', opts) |
| 33 | end | 47 | end |
| | 48 | |
| 34 | end | 49 | end |
| 35 | end | 50 | end |