From 65a7c70ee54575f0373b2000a51ba32aa7792fc9 Mon Sep 17 00:00:00 2001 From: gryf Date: Sat, 4 May 2019 11:23:41 -0600 Subject: [PATCH] Cleaned up converter.rb a bit --- converter.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/converter.rb b/converter.rb index 16567c0..587a6c2 100644 --- a/converter.rb +++ b/converter.rb @@ -8,7 +8,7 @@ module Jekyll priority :low def matches(ext) - ext =~ /rst/i + ext =~ /^\.rst$/i end def output_ext(ext) @@ -16,9 +16,9 @@ module Jekyll end def convert(content) - # RbST.executables = {:html => "/usr/local/bin/rst2html5"} - RbST.executables = {:html => "#{File.expand_path(File.dirname(__FILE__))}/rst2html5.py"} - rst2htmlcontent = RbST.new(content).to_html(:initial_header_level => 1) + dirname = "#{File.expand_path(File.dirname(__FILE__))}" + RbST.executables = {:html => dirname + "/rst2html5.py"} + rst2htmlcontent = RbST.new(content).to_html(:initial_header_level => 2) document = Nokogiri::HTML(rst2htmlcontent) content = document.css('body').inner_html end