Files
q-tools/reporting/md-view
ville rantanen 5e0afc4d09 markdown tools
2015-06-09 12:28:35 +03:00

17 lines
387 B
Bash
Executable File

#!/bin/bash
function helpexit() {
echo "View a markdown document"
echo "Give filename(s) as the argument"
echo " Depends on pandoc and lynx "
exit
}
[[ -z "$1" ]] && helpexit
[[ "$1" = "-h" ]] && helpexit
tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/markdown$$.html
trap "rm -f $tempfile" 0 1 2 5 15
cat "$@" | pandoc -s > "$tempfile"
lynx -force_html "$tempfile"