Unified · Split
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Marionette |
| 3 | − class EntriesFilter < Docs::EntriesFilter | |
| 3 | + class EntriesV2Filter < Docs::EntriesFilter | |
| 4 | 4 | def get_name |
| 5 | 5 | name = at_css('h1').content.strip |
| 6 | 6 | name.remove!(/Marionette./) |
| @@ -0,0 +1,39 @@ | ||
| 1 | +module Docs | |
| 2 | + class Marionette | |
| 3 | + class EntriesV3Filter < Docs::EntriesFilter | |
| 4 | + def get_name | |
| 5 | + name = at_css('h1').content.strip | |
| 6 | + name.remove!(/Marionette./) | |
| 7 | + name = name[0].upcase + name.from(1) | |
| 8 | + name | |
| 9 | + end | |
| 10 | + | |
| 11 | + def get_type | |
| 12 | + type = name.dup | |
| 13 | + type = 'CollectionView' if type.include?('CollectionView') | |
| 14 | + type = 'Miscellaneous' if %w(Features Installing\ Marionette Upgrade\ Guide Common\ Concepts Common\ Functionality).include?(type) | |
| 15 | + type | |
| 16 | + end | |
| 17 | + | |
| 18 | + def additional_entries | |
| 19 | + if slug == 'marionette.behavior' | |
| 20 | + css('#documentation-index + ul a[href="#api"] + ul a').map do |node| | |
| 21 | + ["#{name}: #{node.content}", node['href'].remove('#')] | |
| 22 | + end | |
| 23 | + else | |
| 24 | + css('#documentation-index + ul a').each_with_object [] do |node, entries| | |
| 25 | + content = node.content.strip | |
| 26 | + content.remove! '\'s' | |
| 27 | + id = node['href'].remove('#') | |
| 28 | + next if content == name | |
| 29 | + if content.start_with?(name) || content.start_with?('Marionette.') | |
| 30 | + entries << [content, id] | |
| 31 | + elsif content =~ /\A"?[a-z]/ | |
| 32 | + entries << ["#{name.sub('View Lifecycle', 'View')} #{content}", id] | |
| 33 | + end | |
| 34 | + end | |
| 35 | + end | |
| 36 | + end | |
| 37 | + end | |
| 38 | + end | |
| 39 | +end | |
| @@ -5,11 +5,11 @@ module Docs · 4 unmodified lines | ||
| 5 | 5 | self.type = 'marionette' |
| 6 | 6 | self.root_path = 'index' |
| 7 | 7 | self.links = { |
| 8 | − home: 'http://marionettejs.com/', | |
| 8 | + home: 'https://marionettejs.com/', | |
| 9 | 9 | code: 'https://github.com/marionettejs/backbone.marionette' |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | − html_filters.push 'marionette/clean_html', 'marionette/entries' | |
| 12 | + html_filters.push 'marionette/clean_html' | |
| 13 | 13 | |
| 14 | 14 | options[:container] = '.docs__content' |
| 15 | 15 | |
| @@ -19,13 +19,17 @@ module Docs · 3 unmodified lines | ||
| 19 | 19 | HTML |
| 20 | 20 | |
| 21 | 21 | version '3' do |
| 22 | − self.release = '3.0.0' | |
| 23 | − self.base_url = "http://marionettejs.com/docs/v#{release}/" | |
| 22 | + self.release = '3.1.0' | |
| 23 | + self.base_url = "https://marionettejs.com/docs/v#{release}/" | |
| 24 | + | |
| 25 | + html_filters.push 'marionette/entries_v3' | |
| 24 | 26 | end |
| 25 | 27 | |
| 26 | 28 | version '2' do |
| 27 | 29 | self.release = '2.4.7' |
| 28 | − self.base_url = "http://marionettejs.com/docs/v#{release}/" | |
| 30 | + self.base_url = "https://marionettejs.com/docs/v#{release}/" | |
| 31 | + | |
| 32 | + html_filters.push 'marionette/entries_v2' | |
| 29 | 33 | end |
| 30 | 34 | end |
| 31 | 35 | end |