babel.rb 885 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. module Docs
  2. class Babel < UrlScraper
  3. self.type = 'simple'
  4. self.base_url = 'https://babeljs.io/docs/en/'
  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[:attribution] = <<-HTML
  24. &copy; 2020 Sebastian McKenzie<br>
  25. Licensed under the MIT License.
  26. HTML
  27. version '7' do
  28. self.release = '7.12.6'
  29. end
  30. version '6' do
  31. self.release = '6.26.1'
  32. end
  33. def get_latest_version(opts)
  34. get_latest_github_release('babel', 'babel', opts)
  35. end
  36. end
  37. end