class PBSimply::Processor::PbsKramdown
Public Class Methods
new(config)
click to toggle source
Calls superclass method
PBSimply::new
# File lib/pbsimply.rb, line 1023 def initialize(config) require 'kramdown' super end
Public Instance Methods
print_fileproc_msg(filename)
click to toggle source
# File lib/pbsimply.rb, line 1028 def print_fileproc_msg(filename) STDERR.puts "#{filename} generate with Kramdown" end
process_document(dir, filename, frontmatter, orig_filepath, ext, procdoc)
click to toggle source
# File lib/pbsimply.rb, line 1032 def process_document(dir, filename, frontmatter, orig_filepath, ext, procdoc) # Set feature options features = @config["kramdown_features"] || {} # Getting HTML string. markdown = Kramdown::Document.new(File.read(procdoc), **features) article_body = markdown.to_html # Process with eRuby temaplte. erb_template = ERB.new(File.read(@config["template"]), trim_mode: '%<>') doc = erb_template.result(binding) doc end