Module: Haml::Filters::Documentation

Includes:
Base
Defined in:
lib/rbbt/rest/common/misc.rb

Instance Method Summary collapse

Instance Method Details

#render(text) ⇒ Object



282
283
284
285
286
287
288
289
290
# File 'lib/rbbt/rest/common/misc.rb', line 282

def render(text)
  doc_text =<<-EOF
%section.documentation#{ text.gsub(/\s/,'').length < 80 * 10 ? '.short' : ''}
:markdown
#{text.gsub(/^/,"    ")}
  EOF

  Haml::Engine.new(doc_text).to_html  
end