Skip to content

Instantly share code, notes, and snippets.

@vrld
Created July 9, 2019 08:00
Show Gist options
  • Save vrld/193faa6665aec3e1bca497cca7b2bece to your computer and use it in GitHub Desktop.
Save vrld/193faa6665aec3e1bca497cca7b2bece to your computer and use it in GitHub Desktop.
Live Markdown Preview powered by pandoc and entr
#!/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}
@vrld
Copy link
Author

vrld commented Jul 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment