Class: Webgen::ContentProcessor::Maruku
- Inherits:
-
Object
- Object
- Webgen::ContentProcessor::Maruku
- Defined in:
- lib/webgen/contentprocessor/maruku.rb
Overview
Processes content in Markdown format using the maruku
library.
Instance Method Summary collapse
-
#call(context) ⇒ Object
Convert the content in
context
to HTML.
Instance Method Details
#call(context) ⇒ Object
Convert the content in context
to HTML.
9 10 11 12 13 14 15 16 |
# File 'lib/webgen/contentprocessor/maruku.rb', line 9 def call(context) require 'maruku' $uid = 0 #fix for invalid fragment ids on second run context.content = ::Maruku.new(context.content, :on_error => :raise).to_html context rescue Exception => e raise RuntimeError, "Maruku to HTML conversion failed for <#{context.ref_node.absolute_lcn}>: #{e.}", e.backtrace end |