Sha256: b6f7f7ae90dcc4923696e1124ac943c31d735093de741fe8b8e0d3ddfea1a1eb

Contents?: true

Size: 559 Bytes

Versions: 2

Compression:

Stored size: 559 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.alcn}>: #{e.message}", e.backtrace
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gettalong-webgen-0.5.9.20090620 lib/webgen/contentprocessor/maruku.rb
gettalong-webgen-0.5.9.20090626 lib/webgen/contentprocessor/maruku.rb