class PBSimply::Processor::PbsRedCarpet
Public Class Methods
new(config)
click to toggle source
Calls superclass method
PBSimply::new
# File lib/pbsimply.rb, line 995 def initialize(config) require 'redcarpet' super end
Public Instance Methods
print_fileproc_msg(filename)
click to toggle source
# File lib/pbsimply.rb, line 1005 def print_fileproc_msg(filename) STDERR.puts "#{filename} generate with Redcarpet Markdown" end
process_document(dir, filename, frontmatter, orig_filepath, ext, procdoc)
click to toggle source
# File lib/pbsimply.rb, line 1009 def process_document(dir, filename, frontmatter, orig_filepath, ext, procdoc) # Getting HTML string. markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, **@rc_extension) article_body = markdown.render(File.read procdoc) # Process with eRuby temaplte. erb_template = ERB.new(File.read(@config["template"]), trim_mode: '%<>') doc = erb_template.result(binding) doc end
setup_config(dir)
click to toggle source
Calls superclass method
PBSimply#setup_config
# File lib/pbsimply.rb, line 1000 def setup_config(dir) super @rc_extension = @config["redcarpet_extensions"] || {} end