Skip to content

Instantly share code, notes, and snippets.

@apiarian
Created April 3, 2016 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apiarian/52915de1135918b636fd1fd61cc3df70 to your computer and use it in GitHub Desktop.
Save apiarian/52915de1135918b636fd1fd61cc3df70 to your computer and use it in GitHub Desktop.

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