A small script to watch a Markdown-File and display it in Terminal - i use it with vim in one dvtm-screen and this script in another
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 | |
clear; | |
pandoc -f markdown -s $1 > $1.html; | |
lynx --dump $1.html; | |
rm $1.html; | |
while true | |
do | |
change=$(inotifywait -e close_write,moved_to,create -q .) | |
change=${change#./ * } | |
if [ "$change" = $1 ]; then | |
clear; | |
pandoc -f markdown -s $1 > $1.html; | |
lynx --dump $1.html; | |
rm $1.html; | |
sleep 1; | |
fi; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
aaaand the first bugs
lynx doesn't like endings other then .html and deleting that temp-file directly after displaying it is far more logical then after while(true)