UNPKG

291 BPlain TextView Raw
1module Styledown
2 extend self
3
4 def context
5 @context ||= begin
6 require 'execjs'
7 fn = File.expand_path('../styledown.js', __FILE__)
8 ExecJS.compile(File.read(fn))
9 end
10 end
11
12 def parse(code, options={})
13 context.call('Styledown.parse', code, options)
14 end
15end