compile.sh (397B)
1 #!/usr/bin/env sh 2 # this takes a .remark file and wraps it in the html template 3 4 if [ $# -eq 0 ]; then 5 echo -e "No arguments specified.">&2 6 exit 1 7 fi 8 9 if [ ! -f "$1" ]; then 10 echo "$1: No such file">&2 11 exit 1 12 fi 13 14 remarkdir=$(dirname "$0") 15 file=$(readlink -f "$1") 16 sourcebase="${file%.*}" 17 cat "$remarkdir"/template-start.html "$1" "$remarkdir"/template-end.html > "$sourcebase".html