Skip to content

Commit

Permalink
refine preview.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
skyshaw committed May 9, 2012
1 parent 1e3623a commit 2996335
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions sh/preview.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ USAGE="usage: preview.sh [option] [filename]
-m preview markdown file
-h preview html file"


if [[ "$1" == "-m" ]]; then
echo here
TMPFILE=$(mktemp) && \
pandoc -o $TMPuILE -t html -f markdown $2 && $BROWSER $TMPFILE
elif [[ "$1" == "-h" ]]; then
$BROWSER $2
else
echo "$USAGE"
fi
case "$1" in
"-m" ) (TMPFILE=$(mktemp) && \
pandoc -o $TMPFILE -t html -f markdown $2 && $BROWSER $TMPFILE)
;;
"-r" ) (TMPFILE=$(mktemp) && \
pandoc -o $TMPFILE -t html -f rst $2 && $BROWSER $TMPFILE)
;;
"-h" ) $BROWSER $2
;;
*) echo "$USAGE"
;;
esac

0 comments on commit 2996335

Please sign in to comment.