all repos — markup @ b29b70118618a7f1a67567fd4ba3331fc3e26331

The code we use to render README.your_favorite_markup

define markups in a separate file
Chris Wanstrath chris@ozmm.org
Fri, 30 Oct 2009 18:59:17 -0700
commit

b29b70118618a7f1a67567fd4ba3331fc3e26331

parent

768130a25a0fb9ed979887ad039b796237397f99

2 files changed, 11 insertions(+), 8 deletions(-)

jump to
M lib/github/markup.rblib/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