class Dropdown::MarkdownRenderer

Attributes

file_path[R]
reader[RW]

Public Class Methods

new(file_path) click to toggle source
# File lib/dropdown/markdown_renderer.rb, line 8
def initialize(file_path)
  @file_path = file_path
  @markdown = Redcarpet::Markdown.new Redcarpet::Render::HTML
end

Public Instance Methods

output_filename() click to toggle source
# File lib/dropdown/markdown_renderer.rb, line 17
def output_filename
  File.basename(file_path, '.md') + '.html'
end
render() click to toggle source
# File lib/dropdown/markdown_renderer.rb, line 13
def render
  @markdown.render reader.read(file_path)
end