immutable.rb 896 B

1234567891011121314151617181920212223242526272829303132333435
  1. module Docs
  2. class Immutable < UrlScraper
  3. self.name = 'Immutable.js'
  4. self.slug = 'immutable'
  5. self.type = 'simple'
  6. self.release = '4.1.0'
  7. self.base_url = "https://immutable-js.com/docs/v#{release}/"
  8. self.links = {
  9. home: 'https://immutable-js.com/',
  10. code: 'https://github.com/facebook/immutable-js'
  11. }
  12. html_filters.push 'immutable/clean_html', 'immutable/entries'
  13. options[:container] = '.docContents'
  14. options[:root_title] = 'Immutable.js'
  15. options[:trailing_slash] = true
  16. options[:fix_urls] = ->(url) do
  17. url.sub! '/index.html', ''
  18. url.sub! '/index', ''
  19. url
  20. end
  21. options[:attribution] = <<-HTML
  22. &copy; 2014–present, Lee Byron and other contributors<br>
  23. Licensed under the 3-clause BSD License.
  24. HTML
  25. def get_latest_version(opts)
  26. get_npm_version('immutable', opts)
  27. end
  28. end
  29. end