Parent

Methods

Included Modules

Class/Module Index [+]

Quicksearch

Webgen::ContentProcessor::Kramdown

Processes content in kramdown format (based on Markdown) using the kramdown library.

Public Instance Methods

call(context) click to toggle source

Convert the content in context to HTML.

# File lib/webgen/contentprocessor/kramdown.rb, line 10
def call(context)
  require 'kramdown'
  require 'webgen/contentprocessor/kramdown/html'
  doc = ::Kramdown::Document.new(context.content,
                                 context.website.config['contentprocessor.kramdown.options'].merge(context.options['contentprocessor.kramdown.options'] || {}))
  context.content = KramdownHtmlConverter.convert(doc.root, doc.options, context)
  doc.warnings.each do |warn|
    log(:warn) { "Warning while parsing <#{context.ref_node}> with kramdown: #{warn}" }
  end
  context
rescue LoadError
  raise Webgen::LoadError.new('kramdown', self.class.name, context.dest_node, 'kramdown')
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.