Skip to content

Instantly share code, notes, and snippets.

@zyuiop
Created September 22, 2020 19:30
Show Gist options
  • Save zyuiop/d164631810f1fe6173c30820421ed9b2 to your computer and use it in GitHub Desktop.
Save zyuiop/d164631810f1fe6173c30820421ed9b2 to your computer and use it in GitHub Desktop.
Pandoc preview: a small script that renders a preview of a markdown document through pandoc "live"
file=$1
target=.~$file.pdf
pandoc -i "$file" -o "$target"
okular "$target" &
inotifywait -q -m -e close_write "$file" |
while read -r filename event; do
echo "Building $file to $target..."
pandoc -i "$file" -o "$target"
echo "Done"
echo ""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment