babel.rb 994 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. module Docs
  2. class Babel < UrlScraper
  3. self.type = 'simple'
  4. self.base_url = 'https://babeljs.io/docs/'
  5. self.links = {
  6. home: 'https://babeljs.io/',
  7. code: 'https://github.com/babel/babel'
  8. }
  9. html_filters.push 'babel/clean_html', 'babel/entries'
  10. options[:trailing_slash] = true
  11. options[:skip_patterns] = [
  12. /usage/,
  13. /configuration/,
  14. /learn/,
  15. /v7-migration/,
  16. /v7-migration-api/,
  17. /editors/,
  18. /presets/,
  19. /caveats/,
  20. /faq/,
  21. /roadmap/
  22. ]
  23. options[:skip_link] = ->(link) {
  24. link['href'].include?('https://babeljs.io/docs/en/')
  25. }
  26. options[:attribution] = <<-HTML
  27. &copy; 2014-present Sebastian McKenzie<br>
  28. Licensed under the MIT License.
  29. HTML
  30. version '7' do
  31. self.release = '7.21.4'
  32. end
  33. version '6' do
  34. self.release = '6.26.1'
  35. end
  36. def get_latest_version(opts)
  37. get_latest_github_release('babel', 'babel', opts)
  38. end
  39. end
  40. end