class MarkdownWriter

Documentation for RedCarpet: github.com/vmg/redcarpet

Public Class Methods

to_html(markdown) click to toggle source
# File lib/railsbricks/assets/lib/markdown_writer.rb, line 4
def self.to_html(markdown)
  renderer = Redcarpet::Render::HTML.new(filter_html: false,
  no_styles: true,
  no_images: false,
  with_toc_data: false,
  link_attributes: {:target => "_blank"}
  )
  converter = Redcarpet::Markdown.new(renderer)
  output = converter.render(markdown)
end
update_html(obj) click to toggle source
# File lib/railsbricks/assets/lib/markdown_writer.rb, line 15
def self.update_html(obj)
  obj.content_html = MarkdownWriter.to_html(obj.content_md)
end