module Mdx

Public Class Methods

process(filename, options = {}) click to toggle source
# File lib/mdx.rb, line 59
def self.process filename, options = {}
  content = File.read(filename).force_encoding(Encoding::UTF_8)
  md = Redcarpet::Markdown.new(MdxRender.new, fenced_code_blocks: true)
  html = md.render(content)
  File.write("#{File.dirname(filename)}/#{File.basename(filename, '.md')}.html", html)
end