knockout.rb 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. module Docs
  2. class Knockout < UrlScraper
  3. self.name = 'Knockout.js'
  4. self.slug = 'knockout'
  5. self.type = 'knockout'
  6. self.release = '3.4.2'
  7. self.base_url = 'http://knockoutjs.com/documentation/'
  8. self.root_path = 'introduction.html'
  9. html_filters.push 'knockout/clean_html', 'knockout/entries'
  10. options[:follow_links] = ->(filter) { filter.root_page? }
  11. options[:container] = ->(filter) { filter.root_page? ? '#wrapper' : '.content' }
  12. options[:only] = %w(
  13. json-data.html
  14. extenders.html
  15. deferred-updates.html
  16. unobtrusive-event-handling.html
  17. fn.html
  18. microtasks.html
  19. asynchronous-error-handling.html
  20. amd-loading.html)
  21. options[:only_patterns] = [
  22. /observable/i,
  23. /computed/i,
  24. /component/i,
  25. /binding/,
  26. /plugin/]
  27. options[:attribution] = <<-HTML
  28. &copy; Steven Sanderson, the Knockout.js team, and other contributors<br>
  29. Licensed under the MIT License.
  30. HTML
  31. def get_latest_version(opts)
  32. get_latest_github_release('knockout', 'knockout', opts)
  33. end
  34. end
  35. end