class Troy::Markdown

Attributes

markup[R]

Set the Markdown markup that must be rendered.

Public Class Methods

new(markup) click to toggle source
# File lib/troy/markdown.rb, line 31
def initialize(markup)
  @markup = markup
end

Public Instance Methods

renderer() click to toggle source
# File lib/troy/markdown.rb, line 35
def renderer
  @renderer ||= Redcarpet::Markdown.new(Renderer,
                                        autolink: true,
                                        space_after_headers: true,
                                        fenced_code_blocks: true,
                                        footnotes: true)
end
to_html() click to toggle source
# File lib/troy/markdown.rb, line 43
def to_html
  renderer.render(markup)
end