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 ="%section.documentation\#{ text.gsub(/\\s/,'').length < 80 * 10 ? '.short' : ''}\n:markdown\n\#{text.gsub(/^/,\"    \")}\n    EOF\n\n  Haml::Engine.new(doc_text).to_html  \nend\n"