Skip to content

Instantly share code, notes, and snippets.

@joelmoss
Forked from defunkt/my_view.rb
Created April 28, 2010 08:07
Show Gist options
  • Save joelmoss/381858 to your computer and use it in GitHub Desktop.
Save joelmoss/381858 to your computer and use it in GitHub Desktop.

Revisions

  1. @defunkt defunkt created this gist Apr 27, 2010.
    9 changes: 9 additions & 0 deletions my_view.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    class MyView < Mustache
    def markdown(str = nil)
    if str
    Markdown.new(str.to_s).to_html
    else
    lambda { |text| markdown(render(text)) }
    end
    end
    end
    5 changes: 5 additions & 0 deletions template.mustache
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    <div class="column main">
    {{# markdown}}
    {{{ description }}}
    {{/ markdown}}
    </div>