markdown tools
This commit is contained in:
16
reporting/md-view
Executable file
16
reporting/md-view
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/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"
|
||||
Reference in New Issue
Block a user