2021-01-11 15:32:09 +01:00
|
|
|
#!/bin/sh
|
|
|
|
exec ruby -x "$0" "$@"
|
|
|
|
#!ruby
|
|
|
|
|
|
|
|
# src2md.rb
|
|
|
|
|
|
|
|
require_relative 'lib/lib_src2md.rb'
|
|
|
|
|
|
|
|
def usage
|
2022-04-25 10:01:44 +02:00
|
|
|
$stderr.print "Usage: ruby srcd2md.rb XXXX.src.md type\n"
|
|
|
|
$stderr.print " XXXX.src.md is a .src.md file, which is like sec1.src.md.\n"
|
2022-04-13 13:33:18 +02:00
|
|
|
$stderr.print " type is gfm (default), html or latex.\n"
|
2022-04-25 10:01:44 +02:00
|
|
|
$stderr.print "src2md.rb converts XXXX.src.md into (gfm|docs|latex)/XXXX.md.\n"
|
2021-01-11 15:32:09 +01:00
|
|
|
end
|
|
|
|
|
2022-04-25 10:01:44 +02:00
|
|
|
if ARGV.size == 1
|
|
|
|
src2md ARGV[0], "gfm"
|
|
|
|
elsif ARGV.size == 2
|
|
|
|
src2md ARGV[0], ARGV[1]
|
2021-03-12 06:45:24 +01:00
|
|
|
else
|
2021-01-11 15:32:09 +01:00
|
|
|
usage
|
|
|
|
exit 1
|
|
|
|
end
|