Markdown on Windows

Posted by andrew on February 15, 2005

Back when I still had a Mac, I played around a bit with the Humane Text service. This is a program that converts selections formatted in Markdown to HTML.

(Markdown, if you can’t be bothered to follow the link above, is a human-readable markup inspired by how people “markup” text in plaintext emails.)

I found this particularly useful when I was coding sites, and we’d got to the interminable dump-text-into-templates phase.

I hadn’t found any equivalent for Windows until I was pointed to this post at this is sippey.

Inspired, I hacked together a batch file which I documented in the comments thread. I’ll share this whole process with you here, though.

Install Cygwin, making sure you get perl. Then create a batch file with the following text:

@echo off

C:\cygwin\bin\getclip.exe | C:\cygwin\bin\perl.exe C:\cygwin\home{usr}\bin\Markdown.pl | C:\cygwin\bin\perl.exe C:\cygwin\home{usr}\bin\Smartypants.pl | C:\cygwin\bin\putclip.exe

That second bit is one long line. Edit paths as necessary.

Now, copy a section of markup source, and run this batch file. The contents of your clipboard will be converted into HTML!

Next step: use AutoHotKey to convert a selection in-place, much like the behaviour of the Humane Text service.

Trackbacks

Trackbacks are closed.

Comments

Comments are closed.