Module: Haml::Filters::Documentation

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

Instance Method Summary collapse

Instance Method Details

#render(text) ⇒ Object



389
390
391
392
393
394
395
396
397
398
399
# File 'lib/rbbt/rest/common/misc.rb', line 389

def render(text)
	text = "<br/>" if text.strip.empty?

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

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