Created
July 9, 2019 08:00
-
-
Save vrld/193faa6665aec3e1bca497cca7b2bece to your computer and use it in GitHub Desktop.
Live Markdown Preview powered by pandoc and entr
This file contains hidden or 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/sh | |
usage() { | |
echo "Usage: marknote path" | |
exit -1 | |
} | |
FILE=$1 | |
[ -z "${FILE}" ] && usage | |
HTML=$(mktemp -p . --suffix=".html") | |
echo "" > ${HTML} | |
${BROWSER} "${HTML}" & | |
echo ${FILE} | entr -s "pandoc -s --metadata pagetitle='marknote' ${FILE} -t html -o ${HTML} && refresh-firefox marknote" | |
rm ${HTML} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
refresh-firefox
script here