UVTC's Blog

2011-10-30

I write most of my tech notes in Pandoc’s enhanced Markdown markup format. It’s easy to write and easy to read as plain text as well. To read them as as html, I keep this tiny view-mkdn.py script around:

#!/usr/bin/env python

import sys, os

if len(sys.argv) != 2:
    print "Whoops: Please pass exactly one arg: the filename."
    print "Exiting."
    sys.exit()

mkdn_filename = sys.argv[1]

pandoc_cmd = "pandoc  -s --css=/home/john/tmpl/style.css "
pandoc_cmd += "-o /tmp/foo.html " + mkdn_filename

os.system(pandoc_cmd)
os.system("firefox /tmp/foo.html")