From 5022d1a0df1534b1cbec1cbee23568f201ea1cc6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 9 Jan 2017 16:45:53 -0500 Subject: Implement actual file generation, go through fixing things. --- lib/page_local.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/page_local.rb') diff --git a/lib/page_local.rb b/lib/page_local.rb index ca3aa31..da8689d 100644 --- a/lib/page_local.rb +++ b/lib/page_local.rb @@ -21,15 +21,16 @@ class LocalPage < Page def local_infile ; @infile ; end def local_input ; @input ||= File::read(local_infile); end - def _pandoc - if @pandoc.nil? + def local_intype types = { 'md' => 'markdown' } - ext = File::extname(local_infile).gsub(/^[.]/, '') - type = types[ext] || ext - @pandoc = Pandoc::load(type, local_input) + return types[ext] || ext + end + def _pandoc + if @pandoc.nil? + @pandoc = Pandoc::load(local_intype, local_input) if @pandoc['pandoc_format'] @pandoc = Pandoc::load(@pandoc['pandoc_format'], local_input) -- cgit v1.2.3