templates/rest/layout/html/setup.rb in yard-rest-plugin-0.1.5 vs templates/rest/layout/html/setup.rb in yard-rest-plugin-0.2.0

- old
+ new

@@ -1,5 +1,7 @@ +include Helpers::FilterHelper + def init @breadcrumb = [] @page_title = options[:title] @@ -23,12 +25,20 @@ def contents @contents end def index - @objects_by_letter = {} - objects = @objects.reject {|o| o.root? || o.tags('topic').empty? }.sort_by {|o| o.tags('topic').first.text } - objects.each {|o| (@objects_by_letter[o.tags('topic').first.text[0,1].upcase] ||= []) << o } + + legitimate_objects = @objects.reject {|o| o.root? || !is_class?(o) || o.tags('url').empty?} + topic_objects = legitimate_objects.reject{|o| o.tags('topic').empty? } + @topics = {} + + topic_objects.each do |object| + object.tags('topic').each { |topic| (@topics[topic.text] ||= []) << object } + end + + @resources = legitimate_objects.sort_by {|o| o.tags('url').first.text } + erb(:index) end def diskfile "<div id='filecontents'>" + \ No newline at end of file