Sha256: 98fb060a2881b91b75f4e01a4df691701c6ef5883462904637b5aa0d38394fe2

Contents?: true

Size: 567 Bytes

Versions: 5

Compression:

Stored size: 567 Bytes

Contents

# -*- encoding: utf-8 -*-

module Webgen::ContentProcessor

  # Processes content in Markdown format using the +maruku+ library.
  class Maruku

    # Convert the content in +context+ to HTML.
    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.message}", e.backtrace
    end

  end

end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
gettalong-webgen-0.5.7.20090227 lib/webgen/contentprocessor/maruku.rb
gettalong-webgen-0.5.8.20090507 lib/webgen/contentprocessor/maruku.rb
thewoolleyman-webgen-0.5.8.20090419 lib/webgen/contentprocessor/maruku.rb
webgen-0.5.7 lib/webgen/contentprocessor/maruku.rb
webgen-0.5.8 lib/webgen/contentprocessor/maruku.rb