Sha256: 54fd82bacc543825f5556ce046df6c58a075c01550fa73692d01d7c4c61e743f

Contents?: true

Size: 540 Bytes

Versions: 9

Compression:

Stored size: 540 Bytes

Contents

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

9 entries across 9 versions & 2 rubygems

Version Path
gettalong-webgen-0.5.4.20080929 lib/webgen/contentprocessor/maruku.rb
gettalong-webgen-0.5.5.20081001 lib/webgen/contentprocessor/maruku.rb
gettalong-webgen-0.5.5.20081010 lib/webgen/contentprocessor/maruku.rb
gettalong-webgen-0.5.5.20081012 lib/webgen/contentprocessor/maruku.rb
gettalong-webgen-0.5.6.20081020 lib/webgen/contentprocessor/maruku.rb
webgen-0.5.3 lib/webgen/contentprocessor/maruku.rb
webgen-0.5.4 lib/webgen/contentprocessor/maruku.rb
webgen-0.5.6 lib/webgen/contentprocessor/maruku.rb
webgen-0.5.5 lib/webgen/contentprocessor/maruku.rb