all repos — markup @ 8a8b52e3e33942a230102c7576a441f03721710f

The code we use to render README.your_favorite_markup

okay now you can pass a block to `command` to tinker with the output
Chris Wanstrath chris@ozmm.org
Fri, 30 Oct 2009 23:43:44 -0700
commit

8a8b52e3e33942a230102c7576a441f03721710f

parent

3861e4821e33778c16218b26289abdcb4dab741f

1 files changed, 3 insertions(+), 2 deletions(-)

jump to
M lib/github/markup.rblib/github/markup.rb

@@ -20,14 +20,15 @@ rescue LoadError

nil end - def command(command, regexp) + def command(command, regexp, &block) command = command.to_s if !File.exists?(command) && !command.include?('/') command = File.dirname(__FILE__) + '/commands/' + command.to_s end add_markup(regexp) do |content| - execute(command, content) + rendered = execute(command, content) + block ? block.call(rendered) : rendered end end