Module: Webgen::ContentProcessor::Kramdown
- Defined in:
- lib/webgen/content_processor/kramdown.rb
Overview
Processes content in kramdown format (based on Markdown) using the kramdown
library.
Defined Under Namespace
Classes: CustomHtmlConverter
Class Method Summary collapse
-
.call(context) ⇒ Object
Convert the content in
context
to HTML.
Class Method Details
.call(context) ⇒ Object
Convert the content in context
to HTML.
51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/webgen/content_processor/kramdown.rb', line 51 def self.call(context) = context.website.config['content_processor.kramdown.options'].dup [:link_defs] = context.website.ext.link_definitions.merge([:link_defs] || {}) [:input] = 'WebgenKramdown' doc = ::Kramdown::Document.new(context.content, ) context.content = CustomHtmlConverter.new(doc.root, doc., context).convert(doc.root) context.content.encode!(doc.root.[:encoding]) doc.warnings.each do |warn| context.website.logger.warn { "kramdown warning while parsing <#{context.ref_node}>: #{warn}" } end context end |