lib/malt/engines/kramdown.rb in malt-0.1.1 vs lib/malt/engines/kramdown.rb in malt-0.2.0

- old
+ new

@@ -11,14 +11,17 @@ class Kramdown < Abstract register :markdown, :md # Convert Markdown text to HTML text. + # + # @option params [String] :text Template text + # @option params [String,Symbol] :to ('html') Type or file extension to convert template into. def render(params) - text = params[:text] - format = params[:format] - case format + text = params[:text] + into = params[:to] + case into when :html, nil intermediate(params).to_html when :latex intermediate(params).to_latex else @@ -29,10 +32,9 @@ # Convert Markdown text to intermediate object. def intermediate(params) text = params[:text] ::Kramdown::Document.new(text) end - private # Load rdoc makup library if not already loaded. def initialize_engine