Matt Gillooly bio photo

Matt Gillooly

"Good judgement is the result of experience. Experience is the result of bad judgement." — Fred Brooks

Twitter LinkedIn Instagram Github

When you are writing a Markdown document (perhaps a for a new gem), you may wish to preview what the rendered document will look like.

One cumbersome option is to push your branch to Github periodically, so you can view the rendered version online. Here is a bash function that will allow for a faster workflow:

mdp() {
  local tmpfile='/tmp/markdown-preview.html';
  local srcfile=$1;
  perl ~/bin/ --html4tags $srcfile > $tmpfile;
  open $tmpfile;

You can put this in your .bash_profile and then run mdp to instantly preview your document in a new browser window.


Download from and put it in your ~/bin/ directory (or elsewhere, and update the function to aim correctly at it.)


No syntax highlighting or other Github-specific niceties.