typescript.rb 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. module Docs
  2. class Typescript < UrlScraper
  3. include MultipleBaseUrls
  4. self.name = 'TypeScript'
  5. self.type = 'typescript'
  6. self.release = '5.1.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. /dt\/search/,
  27. /play\//
  28. ]
  29. options[:attribution] = <<-HTML
  30. &copy; 2012-2023 Microsoft<br>
  31. Licensed under the Apache License, Version 2.0.
  32. HTML
  33. def get_latest_version(opts)
  34. get_latest_github_release('Microsoft', 'TypeScript', opts)
  35. end
  36. end
  37. end