Gtk4-tutorial/mktbl.rb
2022-04-17 12:52:12 +09:00

7 lines
245 B
Ruby

require_relative 'lib/lib_src2md.rb'
src = File.read ARGV[0]
buf = src.partitions(/^@@@table\n.*?@@@\n/m)
dst = buf.map{|chunk| chunk=~/\A@@@table/ ? at_table(chunk) : chunk}.join
File.write ARGV[0]+".bak", src # backup
File.write ARGV[0], dst