babel.rb 917 B

12345678910111213141516171819202122232425262728293031
  1. module Docs
  2. class Babel < UrlScraper
  3. self.type = 'babel'
  4. self.base_url = 'http://babeljs.io/docs/'
  5. self.root_path = '/plugins/'
  6. self.release = '6.26.0'
  7. self.initial_paths = %w[faq tour usage/babel-register core-packages editors usage/caveats]
  8. self.links = {
  9. home: 'https://babeljs.io/',
  10. code: 'https://github.com/babel/babel'
  11. }
  12. html_filters.push 'babel/clean_html', 'babel/entries'
  13. options[:trailing_slash] = true
  14. options[:container] = '.docs-content'
  15. options[:skip] = %w{setup/ community/videos/}
  16. options[:fix_urls] = ->(url) do
  17. return url unless url.start_with? self.base_url
  18. url.sub %r{/(index\.\w+)?$}, ''
  19. end
  20. options[:attribution] = <<-HTML
  21. &copy; 2018 Sebastian McKenzie<br>
  22. Licensed under the
  23. <a href="https://github.com/babel/website/blob/master/LICENSE">
  24. MIT License
  25. </a>
  26. HTML
  27. end
  28. end