require "haml" require "coffee-filter" module Middleman module Renderers module Haml class << self def registered(app) app.helpers Middleman::Renderers::Haml::Helpers end alias :included :registered end module Helpers def haml_partial(name, options = {}) partial(name, options) end end module Table include ::Haml::Filters::Base def render(text) output = '
' line_num = 0 text.each_line do |line| line_num += 1 next if line.strip.empty? output << %Q{} columns = line.split("|").map { |p| p.strip } columns.each_with_index do |col, i| output << %Q{} end output << "" end output + "
#{col}
" end end end end end