diff --git a/converter.rb b/converter.rb index 587a6c2..e18db1a 100644 --- a/converter.rb +++ b/converter.rb @@ -18,7 +18,17 @@ module Jekyll def convert(content) dirname = "#{File.expand_path(File.dirname(__FILE__))}" RbST.executables = {:html => dirname + "/rst2html5.py"} - rst2htmlcontent = RbST.new(content).to_html(:initial_header_level => 2) + level = 2 + + conf = Jekyll.configuration({}) + if conf.has_key?('rst') + level = conf['rst']['initial_header_level'] + if not level.is_a?(Integer) + level = 2 + end + end + + rst2htmlcontent = RbST.new(content).to_html(:initial_header_level => level) document = Nokogiri::HTML(rst2htmlcontent) content = document.css('body').inner_html end