mirror of
https://github.com/gryf/jekyll-rst.git
synced 2025-12-19 12:28:20 +01:00
Cleaned up converter.rb a bit
This commit is contained in:
@@ -8,7 +8,7 @@ module Jekyll
|
|||||||
priority :low
|
priority :low
|
||||||
|
|
||||||
def matches(ext)
|
def matches(ext)
|
||||||
ext =~ /rst/i
|
ext =~ /^\.rst$/i
|
||||||
end
|
end
|
||||||
|
|
||||||
def output_ext(ext)
|
def output_ext(ext)
|
||||||
@@ -16,9 +16,9 @@ module Jekyll
|
|||||||
end
|
end
|
||||||
|
|
||||||
def convert(content)
|
def convert(content)
|
||||||
# RbST.executables = {:html => "/usr/local/bin/rst2html5"}
|
dirname = "#{File.expand_path(File.dirname(__FILE__))}"
|
||||||
RbST.executables = {:html => "#{File.expand_path(File.dirname(__FILE__))}/rst2html5.py"}
|
RbST.executables = {:html => dirname + "/rst2html5.py"}
|
||||||
rst2htmlcontent = RbST.new(content).to_html(:initial_header_level => 1)
|
rst2htmlcontent = RbST.new(content).to_html(:initial_header_level => 2)
|
||||||
document = Nokogiri::HTML(rst2htmlcontent)
|
document = Nokogiri::HTML(rst2htmlcontent)
|
||||||
content = document.css('body').inner_html
|
content = document.css('body').inner_html
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user