class Blogue::KramdownTemplateHandler

Attributes

preprocessor[W]

Public Class Methods

new(options = {}) click to toggle source
# File lib/blogue/kramdown_template_handler.rb, line 5
def initialize(options = {})
  @options = options
end

Public Instance Methods

call(template) click to toggle source
# File lib/blogue/kramdown_template_handler.rb, line 9
def call(template)
  @preprocessor.call(template) if @preprocessor.respond_to?(:call)
  mdown = ActionView::Template.registered_template_handler(:erb).(template)
  "Kramdown::Document.new(begin;#{mdown};end, #{@options.inspect}).to_html"
end