From cd9f50c38b53873036e3980cb30564b8213620b0 Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Sun, 12 Jun 2016 10:32:17 -0400 Subject: [PATCH] Update Marionette.js documentation (2.4.7) --- lib/docs/filters/marionette/entries.rb | 23 +++++++++++++++++++++++ lib/docs/scrapers/marionette.rb | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/lib/docs/filters/marionette/entries.rb b/lib/docs/filters/marionette/entries.rb index 37cad2e8..37ee3600 100644 --- a/lib/docs/filters/marionette/entries.rb +++ b/lib/docs/filters/marionette/entries.rb @@ -7,6 +7,29 @@ module Docs name = name[0].upcase + name.from(1) name end + + def get_type + name + end + + def additional_entries + if slug == 'marionette.behavior' + css('#documentation-index + ul a[href="#api"] + ul a').map do |node| + ["#{name}: #{node.content}", node['href'].remove('#')] + end + else + css('#documentation-index + ul a').each_with_object [] do |node, entries| + content = node.content.strip + content.remove! '\'s' + id = node['href'].remove('#') + if content.start_with?(name) || content.start_with?('Marionette.') + entries << [content, id] + elsif content =~ /\A"?[a-z]/ + entries << ["#{name} #{content}", id] + end + end + end + end end end end diff --git a/lib/docs/scrapers/marionette.rb b/lib/docs/scrapers/marionette.rb index ac0df5ef..a98949de 100644 --- a/lib/docs/scrapers/marionette.rb +++ b/lib/docs/scrapers/marionette.rb @@ -3,7 +3,7 @@ module Docs self.name = 'Marionette.js' self.slug = 'marionette' self.type = 'marionette' - self.release = '2.5.6' + self.release = '2.4.7' self.base_url = "http://marionettejs.com/docs/v#{release}/" self.root_path = 'index' self.links = {