use initialize/render flow for markup
This commit is contained in:
+20
-4
@@ -1,14 +1,30 @@
|
|||||||
module Gollum
|
module Gollum
|
||||||
class Markup
|
class Markup
|
||||||
# Render the content with Gollum wiki syntax on top of the file's own
|
# Initialize a new Markup object.
|
||||||
# markup language.
|
|
||||||
#
|
#
|
||||||
# name - The String filename of the page.
|
# name - The String filename of the page.
|
||||||
# data - The String contents 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.
|
# Returns the formatted String content.
|
||||||
def self.render(name, data)
|
def render
|
||||||
GitHub::Markup.render(name, data) rescue nil
|
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
|
end
|
||||||
end
|
end
|
||||||
+1
-1
@@ -35,7 +35,7 @@ module Gollum
|
|||||||
#
|
#
|
||||||
# Returns the String data.
|
# Returns the String data.
|
||||||
def formatted_data
|
def formatted_data
|
||||||
Gollum::Markup.render(@blob.name, @blob.data) rescue nil
|
Gollum::Markup.new(@blob.name, @blob.data).render rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# Public: The format of the page.
|
# Public: The format of the page.
|
||||||
|
|||||||
Reference in New Issue
Block a user