pull out markup to its own class

This commit is contained in:
Tom Preston-Werner
2010-04-17 22:56:16 -07:00
parent 8bbd44fdfc
commit 9d29ec6485
3 changed files with 16 additions and 1 deletions
+1
View File
@@ -6,6 +6,7 @@ require 'github/markup'
require 'gollum/wiki'
require 'gollum/page'
require 'gollum/file'
require 'gollum/markup'
module Gollum
VERSION = '0.0.1'
+14
View File
@@ -0,0 +1,14 @@
module Gollum
class Markup
# Render the content with Gollum wiki syntax on top of the file's own
# markup language.
#
# name - The String filename of the page.
# data - The String contents of the page.
#
# Returns the formatted String content.
def self.render(name, data)
GitHub::Markup.render(name, data) rescue nil
end
end
end
+1 -1
View File
@@ -35,7 +35,7 @@ module Gollum
#
# Returns the String data.
def formatted_data
GitHub::Markup.render(@blob.name, @blob.data) rescue nil
Gollum::Markup.render(@blob.name, @blob.data) rescue nil
end
# Public: The format of the page.