rocco/lib/rocco/layout.rb
2010-03-08 17:09:18 -08:00

25 lines
365 B
Ruby

require 'mustache'
class Rocco::Layout < Mustache
self.template_path = File.dirname(__FILE__)
def initialize(doc)
@doc = doc
end
def title
File.basename(@doc.file)
end
def sections
num = 0
@doc.sections.map do |docs,code|
{
:docs => docs,
:code => code,
:num => (num += 1)
}
end
end
end