typescript.rb 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. module Docs
  2. class Typescript < UrlScraper
  3. self.name = 'TypeScript'
  4. self.type = 'simple'
  5. self.release = '4.1.2'
  6. self.base_url = 'https://www.typescriptlang.org/docs/handbook/'
  7. self.root_path = 'index.html'
  8. self.links = {
  9. home: 'https://www.typescriptlang.org',
  10. code: 'https://github.com/Microsoft/TypeScript'
  11. }
  12. html_filters.push 'typescript/entries', 'typescript/clean_html', 'title'
  13. options[:container] = 'main'
  14. options[:skip] = [
  15. 'react-&-webpack.html',
  16. 'asp-net-core.html',
  17. 'gulp.html',
  18. 'dom-manipulation.html',
  19. 'migrating-from-javascript.html',
  20. 'babel-with-typescript.html',
  21. 'intro.html'
  22. ]
  23. options[:skip_patterns] = [
  24. /2/,
  25. /typescript-/,
  26. /release-notes/,
  27. /introduction/,
  28. /tutorials/,
  29. /intro.html/
  30. ]
  31. options[:attribution] = <<-HTML
  32. &copy; 2012-2020 Microsoft<br>
  33. Licensed under the Apache License, Version 2.0.
  34. HTML
  35. def get_latest_version(opts)
  36. get_latest_github_release('Microsoft', 'TypeScript', opts)
  37. end
  38. end
  39. end