diff --git a/Rakefile b/Rakefile index 4f04404..8850efb 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,4 @@ +require 'md2man/roff/engine' require 'rake/clean' SOURCE_DIR = 'doc'.freeze @@ -25,5 +26,6 @@ CLOBBER.include(OUTPUT_DIR) rule OUTPUT_EXT => -> (name) { out_to_source(name) } do |t| mkdir_p t.name.pathmap('%d') - sh "pandoc -s -t man -o '#{t.name}' '#{t.source}'" + roff_output = Md2Man::Roff::ENGINE.render(File.read(t.source)) + File.write t.name, roff_output end diff --git a/libexec/um-read.rb b/libexec/um-read.rb index 96dcb3e..1ccbcce 100644 --- a/libexec/um-read.rb +++ b/libexec/um-read.rb @@ -1,3 +1,4 @@ +require 'md2man/roff/engine' require 'shellwords' require 'tempfile' require_relative '../lib/um.rb' @@ -36,14 +37,8 @@ if File.extname(page_path) == UmConfig::UM_MARKDOWN_EXT begin temp_file = Tempfile.new('um') - pandoc_output = `pandoc -s -t man "#{page_path}" > "#{temp_file.path}"` - unless $?.success? - $stderr.puts "Could not convert " + - "#{page_name} #{UM_MARKDOWN_EXT} file to man page." - $stderr.puts pandoc_output - exit 1 - end - + roff_output = Md2Man::Roff::ENGINE.render(File.read(page_path)) + File.write temp_file.path, roff_output system(%{man "#{temp_file.path}"}) ensure temp_file.unlink