Update Marionette.js documentation (3.1.0, 2.4.7)

pull/513/head
Thibaut Courouble 8 years ago
parent fb7e5c7948
commit 2cab067e91

@ -1,6 +1,6 @@
module Docs
class Marionette
class EntriesFilter < Docs::EntriesFilter
class EntriesV2Filter < Docs::EntriesFilter
def get_name
name = at_css('h1').content.strip
name.remove!(/Marionette./)

@ -0,0 +1,39 @@
module Docs
class Marionette
class EntriesV3Filter < Docs::EntriesFilter
def get_name
name = at_css('h1').content.strip
name.remove!(/Marionette./)
name = name[0].upcase + name.from(1)
name
end
def get_type
type = name.dup
type = 'CollectionView' if type.include?('CollectionView')
type = 'Miscellaneous' if %w(Features Installing\ Marionette Upgrade\ Guide Common\ Concepts Common\ Functionality).include?(type)
type
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('#')
next if content == name
if content.start_with?(name) || content.start_with?('Marionette.')
entries << [content, id]
elsif content =~ /\A"?[a-z]/
entries << ["#{name.sub('View Lifecycle', 'View')} #{content}", id]
end
end
end
end
end
end
end

@ -5,11 +5,11 @@ module Docs
self.type = 'marionette'
self.root_path = 'index'
self.links = {
home: 'http://marionettejs.com/',
home: 'https://marionettejs.com/',
code: 'https://github.com/marionettejs/backbone.marionette'
}
html_filters.push 'marionette/clean_html', 'marionette/entries'
html_filters.push 'marionette/clean_html'
options[:container] = '.docs__content'
@ -19,13 +19,17 @@ module Docs
HTML
version '3' do
self.release = '3.0.0'
self.base_url = "http://marionettejs.com/docs/v#{release}/"
self.release = '3.1.0'
self.base_url = "https://marionettejs.com/docs/v#{release}/"
html_filters.push 'marionette/entries_v3'
end
version '2' do
self.release = '2.4.7'
self.base_url = "http://marionettejs.com/docs/v#{release}/"
self.base_url = "https://marionettejs.com/docs/v#{release}/"
html_filters.push 'marionette/entries_v2'
end
end
end

Loading…
Cancel
Save