knockout.rb 848 B

12345678910111213141516171819202122232425262728293031
  1. module Docs
  2. class Knockout < UrlScraper
  3. self.name = 'Knockout.js'
  4. self.slug = 'knockout'
  5. self.type = 'knockout'
  6. self.version = '3.2.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. /binding/,
  20. /plugin/]
  21. options[:attribution] = <<-HTML
  22. &copy; Steven Sanderson, the Knockout.js team, and other contributors<br>
  23. Licensed under the MIT License.
  24. HTML
  25. end
  26. end