rocco/lib/rocco/layout.rb

25 lines
365 B
Ruby
Raw Normal View History

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