def init @breadcrumb = [] @page_title = options[:title] if @file @contents = File.read_binary(@file) @file = File.basename(@file) sections :layout, [:diskfile] elsif object case object when '_index.html' sections :layout, [:index] when CodeObjects::Base type = object.root? ? :module : object.type sections :layout, [T(type)] end else sections :layout, [:contents] end end 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 } erb(:index) end def diskfile "
#{@contents}" when 'textile', 'txtile' htmlify(@contents, :textile) when 'markdown', 'md', 'mdown', 'mkd' htmlify(@contents, :markdown) else htmlify(@contents, diskfile_shebang_or_default) end + "