Use block helper for markdown blocks

openid
Marcin Kulik 12 years ago
parent 8b504d8fea
commit 9e9e3f2662

@ -16,4 +16,9 @@ module ApplicationHelper
image_tag user.avatar_url || default_avatar_url, image_tag user.avatar_url || default_avatar_url,
:title => nickname, :alt => nickname, :class => "avatar" :title => nickname, :alt => nickname, :class => "avatar"
end end
def markdown(&block)
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML)
markdown.render(capture(&block)).html_safe
end
end end

@ -6,8 +6,7 @@
<% unless (defined? skip_description) && skip_description %> <% unless (defined? skip_description) && skip_description %>
<div class="description"> <div class="description">
<% markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML) %> <%= markdown do %><%= asciicast.description.to_s %><% end %>
<%= markdown.render(asciicast.description.to_s).html_safe %>
</div> </div>
<% end %> <% end %>
</div> </div>

@ -51,28 +51,26 @@
<div class="hero-unit"> <div class="hero-unit">
<h2>Use it</h2> <h2>Use it</h2>
<% markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML) %> <%= markdown do %>
<%= markdown.render(<<EOS).html_safe To install or upgrade **ascii.io** recorder, open a terminal and run following command:
To install or upgrade **ascii.io** recorder, open a terminal and run following command:
$ curl -sL get.ascii.io | bash $ curl -sL get.ascii.io | bash
(when using zsh you may need to run `rehash` after above command) (when using zsh you may need to run `rehash` after above command)
That's it! Now you can start recording your terminal sessions with: That's it! Now you can start recording your terminal sessions with:
$ asciiio $ asciiio
If you want your recordings to be assigned to your ascii.io profile (btw, see mine: [~sickill](/~sickill)) run this If you want your recordings to be assigned to your ascii.io profile (btw, see mine: [~sickill](/~sickill)) run this
and follow instructions: and follow instructions:
$ asciiio auth $ asciiio auth
See available commands and options with: See available commands and options with:
$ asciiio -h $ asciiio -h
EOS <% end %>
%>
<%# <%= link_to 'See help', manual_path, :class => "btn btn-large" %1> %> <%# <%= link_to 'See help', manual_path, :class => "btn btn-large" %1> %>
</div> </div>

Loading…
Cancel
Save