Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?

On the OS X bash command line

brew install multimarkdown
brew install fswatch

echo '#!/bin/bash
multimarkdown --full "file.md" > /tmp/file.html && open -g /tmp/file.html' > /tmp/rebuild.sh && chmod +x /tmp/rebuild.sh; fswatch -o "file.md" | xargs -n1 /tmp/rebuild.sh

Safari reuses the same tab for opening a URL that is already open, so it will simply keep refreshing the same file.html tab every time you save changes to file.md. Who needs a dedicated markdown editor with an integrated preview window?

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