Skip to content

Instantly share code, notes, and snippets.

@DrAzraelTod
Created June 28, 2012 10:41
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save DrAzraelTod/3010621 to your computer and use it in GitHub Desktop.
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
#!/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;
@DrAzraelTod
Copy link
Author

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)

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