knockout.rb 887 B

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