| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- module Docs
- class Typescript < UrlScraper
- include MultipleBaseUrls
- self.name = 'TypeScript'
- self.type = 'typescript'
- self.release = '5.3.3'
- self.base_urls = [
- 'https://www.typescriptlang.org/docs/handbook/',
- 'https://www.typescriptlang.org/'
- ]
- 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-2023 Microsoft<br>
- Licensed under the Apache License, Version 2.0.
- HTML
- def get_latest_version(opts)
- get_latest_github_release('Microsoft', 'TypeScript', opts)
- end
- end
- end
|