mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-18 10:07:11 +01:00
31 lines
848 B
Ruby
31 lines
848 B
Ruby
module Docs
|
|
class Knockout < UrlScraper
|
|
self.name = 'Knockout.js'
|
|
self.slug = 'knockout'
|
|
self.type = 'knockout'
|
|
self.version = '3.1.0'
|
|
self.base_url = 'http://knockoutjs.com/documentation/'
|
|
self.root_path = 'introduction.html'
|
|
|
|
html_filters.push 'knockout/clean_html', 'knockout/entries'
|
|
|
|
options[:follow_links] = ->(filter) { filter.root_page? }
|
|
options[:container] = ->(filter) { filter.root_page? ? '#wrapper' : '.content' }
|
|
|
|
options[:only] = %w(
|
|
json-data.html
|
|
extenders.html
|
|
unobtrusive-event-handling.html
|
|
fn.html)
|
|
|
|
options[:only_patterns] = [
|
|
/observable/i,
|
|
/binding/,
|
|
/plugin/]
|
|
|
|
options[:attribution] = <<-HTML
|
|
© Steven Sanderson, the Knockout.js team, and other contributors<br>
|
|
Licensed under the MIT License.
|
|
HTML
|
|
end
|
|
end
|