bin/maruku in maruku-0.5.5 vs bin/maruku in maruku-0.5.6
- old
+ new
@@ -113,11 +113,11 @@
out = doc.to_html( {:indent => -1})
when :pdf, :tex
suffix='.tex'
out = doc.to_latex_document
when :tex_frag
- suffix='.html_frag'
+ suffix='.tex_frag'
out = doc.to_latex
when :inspect
suffix='.txt'
out = doc.inspect
when :markdown
@@ -136,20 +136,26 @@
dir = File.dirname(f)
job = File.join(dir, File.basename(f, File.extname(f)))
output_file = job + suffix
end
- $stderr.puts "Writing to #{output_file}"
- File.open(output_file,'w') do |f| f.puts out end
+ if output_file == "-"
+ $stderr.puts "Writing to standard output"
+ $stdout.puts out
+ else
+ $stderr.puts "Writing to #{output_file}"
+ File.open(output_file,'w') do |f| f.puts out end
+ end
if export == :pdf
cmd = "pdflatex '#{job}' -interaction=nonstopmode "+
"'-output-directory=#{dir}' "
# run twice for cross references
system cmd
system cmd
end
else # write to stdout
+ $stderr.puts "Writing to standard output"
$stdout.puts out
end
end