Sync with latest Maruku
Contains Ari Stern's additions for Blahtex support.
This commit is contained in:
parent
e1c7d035c9
commit
37aff87d71
100 changed files with 715 additions and 2848 deletions
29
vendor/plugins/maruku/bin/marudown
vendored
Normal file
29
vendor/plugins/maruku/bin/marudown
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require 'maruku'
|
||||
|
||||
# If we are given filenames, convert each file
|
||||
if not ARGV.empty?
|
||||
ARGV.each do |f|
|
||||
puts "Opening #{f}"
|
||||
|
||||
# read file content
|
||||
input = File.open(f,'r').read
|
||||
|
||||
# create Maruku
|
||||
doc = Maruku.new(input, {:on_error=>:warning})
|
||||
# convert to a complete html document
|
||||
output = doc.to_md
|
||||
|
||||
# write to file
|
||||
dir = File.dirname(f)
|
||||
filename = File.basename(f, File.extname(f)) + ".txt"
|
||||
|
||||
output = File.join(dir, filename)
|
||||
File.open(output,'w') do |f| f.puts html end
|
||||
end
|
||||
else
|
||||
# else, act as a filter
|
||||
data = $stdin.read
|
||||
puts Maruku.new(data, {:on_error=>:warning}).to_md
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue