knockout.rb 877 B

1234567891011121314151617181920212223242526272829303132
  1. module Docs
  2. class Knockout < UrlScraper
  3. self.name = 'Knockout.js'
  4. self.slug = 'knockout'
  5. self.type = 'knockout'
  6. self.version = '3.0.0'
  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. throttle-extender.html
  16. unobtrusive-event-handling.html
  17. fn.html)
  18. options[:only_patterns] = [
  19. /observable/i,
  20. /binding/,
  21. /plugin/]
  22. options[:attribution] = <<-HTML
  23. &copy; Steven Sanderson, the Knockout.js team, and other contributors<br>
  24. Licensed under the MIT License.
  25. HTML
  26. end
  27. end