Module: Haml::Filters::Documentation

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

Instance Method Summary collapse

Instance Method Details

#render(text) ⇒ Object



294
295
296
297
298
299
300
301
302
# File 'lib/rbbt/rest/common/misc.rb', line 294

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