class PBSimply::Processor::PbsCommonMark

Public Class Methods

new(config) click to toggle source
Calls superclass method PBSimply::new
# File lib/pbsimply.rb, line 1049
def initialize(config)
  require 'commonmarker'
  super
end

Public Instance Methods

print_fileproc_msg(filename) click to toggle source
process_document(dir, filename, frontmatter, orig_filepath, ext, procdoc) click to toggle source
# File lib/pbsimply.rb, line 1058
def process_document(dir, filename, frontmatter, orig_filepath, ext, procdoc)
  # Getting HTML string.
  article_body = CommonMarker.render_doc(File.read(procdoc), :DEFAULT, [:table, :strikethrough]).to_html

  # Process with eRuby temaplte.
  erb_template = ERB.new(File.read(@config["template"]), trim_mode: '%<>')
  doc = erb_template.result(binding)

  doc
end