Class: Cadmus::Renderers::Markdown

Inherits:
Base
  • Object
show all
Defined in:
lib/cadmus/markdown.rb

Overview

A Cadmus renderer that handles Markdown input using the Redcarpet rendering engine. It can produce +:html+ and +:text+ formats, using Cadmus::Markdown::HtmlRenderer and Cadmus::Markdown::TextRenderer.

Liquid is rendered first, then the result is processed as Markdown.

Constant Summary

Constants inherited from Base

Base::DEFAULT_HTML_SANITIZER

Instance Attribute Summary collapse

Attributes inherited from Base

#default_assigns, #default_filters, #default_registers, #html_sanitizer

Instance Method Summary collapse

Methods inherited from Base

#render

Constructor Details

#initializeMarkdown

Returns a new instance of Markdown.



77
78
79
80
# File 'lib/cadmus/markdown.rb', line 77

def initialize
  super
  @markdown_options = {}
end

Instance Attribute Details

#markdown_optionsObject

Additional options to be passed as the second argument to the Redcarpet::Markdown constructor.



75
76
77
# File 'lib/cadmus/markdown.rb', line 75

def markdown_options
  @markdown_options
end

Instance Method Details

#preprocess(template, format, options = {}) ⇒ Object



87
88
89
# File 'lib/cadmus/markdown.rb', line 87

def preprocess(template, format, options={})
  redcarpet_instance.render(super)
end