use initialize/render flow for markup
This commit is contained in:
+20
-4
@@ -1,14 +1,30 @@
|
||||
module Gollum
|
||||
class Markup
|
||||
# Render the content with Gollum wiki syntax on top of the file's own
|
||||
# markup language.
|
||||
# Initialize a new Markup object.
|
||||
#
|
||||
# name - The String filename of the page.
|
||||
# data - The String contents of the page.
|
||||
#
|
||||
# Returns a new Gollum::Markup object, ready for rendering.
|
||||
def initialize(name, data)
|
||||
@name = name
|
||||
@data = data
|
||||
@tagmap = {}
|
||||
end
|
||||
|
||||
# Render the content with Gollum wiki syntax on top of the file's own
|
||||
# markup language.
|
||||
#
|
||||
# Returns the formatted String content.
|
||||
def self.render(name, data)
|
||||
GitHub::Markup.render(name, data) rescue nil
|
||||
def render
|
||||
base_markup = GitHub::Markup.render(@name, @data) rescue nil
|
||||
end
|
||||
|
||||
# Extract all tags into the tagmap and replace with placeholders.
|
||||
#
|
||||
# Returns nothing.
|
||||
def extract_tags
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
+1
-1
@@ -35,7 +35,7 @@ module Gollum
|
||||
#
|
||||
# Returns the String data.
|
||||
def formatted_data
|
||||
Gollum::Markup.render(@blob.name, @blob.data) rescue nil
|
||||
Gollum::Markup.new(@blob.name, @blob.data).render rescue nil
|
||||
end
|
||||
|
||||
# Public: The format of the page.
|
||||
|
||||
Reference in New Issue
Block a user