Created
March 28, 2010 20:11
-
-
Save gnrfan/347001 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# A markdown previewer by Antonio Ognio <[email protected]> | |
# | |
# Should work in a UNIX-like system using Bash such as GNU/Linux or Mac OS X# | |
# It depends on the uuid and markdown commands. | |
# In Ubuntu just type this: apt-get install uuid markdown | |
# | |
UUID=$(uuid) | |
BASENAME=$(basename $1) | |
FILENAME="/tmp/$BASENAME-$UUID.html" | |
echo -n "Creating temporary file at $FILENAME..." | |
markdown $1 > $FILENAME 2> /dev/null | |
echo " [done]" | |
#google-chrome $FILENAME #Uncomment for google-chrome | |
firefox $FILENAME | |
sleep 5 | |
echo -n "Deleting temporary file at $FILENAME..." | |
rm $FILENAME 2>&1 >> /dev/null | |
echo " [done]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment