typescript.rb 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. module Docs
  2. class Typescript < UrlScraper
  3. include MultipleBaseUrls
  4. self.name = 'TypeScript'
  5. self.type = 'typescript'
  6. self.release = '4.2.3'
  7. self.base_urls = [
  8. 'https://www.typescriptlang.org/docs/handbook/',
  9. 'https://www.typescriptlang.org/'
  10. ]
  11. def initial_urls
  12. [ 'https://www.typescriptlang.org/docs/handbook/',
  13. 'https://www.typescriptlang.org/tsconfig' ]
  14. end
  15. self.links = {
  16. home: 'https://www.typescriptlang.org',
  17. code: 'https://github.com/Microsoft/TypeScript'
  18. }
  19. html_filters.push 'typescript/entries', 'typescript/clean_html', 'title'
  20. options[:container] = 'main'
  21. options[:skip] = [
  22. 'react-&-webpack.html'
  23. ]
  24. options[:skip_patterns] = [
  25. /release-notes/,
  26. /play\//
  27. ]
  28. options[:attribution] = <<-HTML
  29. &copy; 2012-2021 Microsoft<br>
  30. Licensed under the Apache License, Version 2.0.
  31. HTML
  32. def get_latest_version(opts)
  33. get_latest_github_release('Microsoft', 'TypeScript', opts)
  34. end
  35. end
  36. end