1
0

typescript.rb 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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'
  13. options[:skip] = [
  14. '/react-&-webpack.html',
  15. '/asp-net-core.html',
  16. '/gulp.html',
  17. '/dom-manipulation.html',
  18. '/migrating-from-javascript.html',
  19. '/babel-with-typescript.html',
  20. '/intro.html'
  21. ]
  22. options[:skip_patterns] = [
  23. /2/,
  24. /typescript-/,
  25. /release-notes/,
  26. /introduction/,
  27. /tutorials/,
  28. /intro.html/
  29. ]
  30. options[:attribution] = <<-HTML
  31. &copy; 2012-2020 Microsoft<br>
  32. Licensed under the Apache License, Version 2.0.
  33. HTML
  34. def get_latest_version(opts)
  35. get_latest_github_release('Microsoft', 'TypeScript', opts)
  36. end
  37. end
  38. end