1
0
mirror of https://github.com/gryf/jekyll-rst.git synced 2025-12-19 20:38:06 +01:00
Files
jekyll-rst/converter.rb
Greg Thornton 6c5e1b585c Initial commit
2011-12-17 16:05:14 -06:00

30 lines
602 B
Ruby

require 'rbst'
module Jekyll
class RestConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /rst/i
end
def output_ext(ext)
".html"
end
def convert(content)
RbST.executables = {:html => "#{File.expand_path(File.dirname(__FILE__))}/rst2html.py"}
RbST.new(content).to_html(:part => :fragment, :initial_header_level => 2)
end
end
module Filters
def restify(input)
site = @context.registers[:site]
converter = site.getConverterImpl(Jekyll::RestConverter)
converter.convert(input)
end
end
end