1
0

typescript.rb 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. module Docs
  2. class Typescript < UrlScraper
  3. include MultipleBaseUrls
  4. self.name = 'TypeScript'
  5. self.type = 'typescript'
  6. self.root_path = 'docs/'
  7. def initial_urls
  8. [ 'https://www.typescriptlang.org/docs/handbook/',
  9. 'https://www.typescriptlang.org/tsconfig' ]
  10. end
  11. self.links = {
  12. home: 'https://www.typescriptlang.org',
  13. code: 'https://github.com/Microsoft/TypeScript'
  14. }
  15. html_filters.push 'typescript/entries', 'typescript/clean_html', 'title'
  16. options[:skip_patterns] = [
  17. /\Abranding/,
  18. /\Acommunity/,
  19. /\Adocs\Z/,
  20. /\Atools/,
  21. /release-notes/,
  22. /dt\/search/,
  23. /play/
  24. ]
  25. options[:attribution] = <<-HTML
  26. &copy; 2012-2025 Microsoft<br>
  27. Licensed under the Apache License, Version 2.0.
  28. HTML
  29. version do
  30. self.release = '5.8.2'
  31. self.base_urls = [
  32. 'https://www.typescriptlang.org/docs/handbook/',
  33. 'https://www.typescriptlang.org/'
  34. ]
  35. end
  36. version '5.1' do
  37. self.release = '5.1.3'
  38. end
  39. def get_latest_version(opts)
  40. get_latest_github_release('Microsoft', 'TypeScript', opts)
  41. end
  42. end
  43. end