typescript.rb 1.0 KB

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