define markups in a separate file
Chris Wanstrath chris@ozmm.org
Fri, 30 Oct 2009 18:59:17 -0700
2 files changed,
11 insertions(+),
8 deletions(-)
M
lib/github/markup.rb
→
lib/github/markup.rb
@@ -26,13 +26,7 @@ def render(filename, content)
renderer(filename)[content] || content end - # Markup definitions - markup(:markdown, /md|mkdn?|markdown/) do |content| - Markdown.new(content).to_html - end - - markup(:redcloth, /textile/) do |content| - RedCloth.new(content).to_html - end + # Define markups + require 'github/markups' end end
A
lib/github/markups.rb
@@ -0,0 +1,9 @@
+GitHub::Markup.instance_eval do + markup(:markdown, /md|mkdn?|markdown/) do |content| + Markdown.new(content).to_html + end + + markup(:redcloth, /textile/) do |content| + RedCloth.new(content).to_html + end +end