1
0
mirror of https://github.com/gryf/jekyll-rst.git synced 2026-01-06 05:44:15 +01:00

Initial commit

This commit is contained in:
Greg Thornton
2011-12-17 16:05:14 -06:00
commit 6c5e1b585c
7 changed files with 299 additions and 0 deletions

30
converter.rb Normal file
View File

@@ -0,0 +1,30 @@
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