![[Photo of fluffy white clouds in a sky which fades from dark blue at the top to a lighter blue at the bottom, with a lens flare in the top right quadrant of the image]](/blogs/toms/photos/current.png)
While googling for something vaguely unrelated, I’ve just come across a handy-looking technique for running John Gruber’s Markdown and SmartyPants scripts on the contents of the Windows clipboard.
You’ll need Cygwin, a Perl install (either Cygwin’s own or ActivePerl will do) and (somewhat obviously) a copy of the Markdown and SmartyPants perl scripts. After that, it’s as simple as creating a batch file to do the job:
C:\cygwin\bin\getclip.exe |
C:\cygwin\bin\perl.exe "C:\Program Files\Markdown\Markdown.pl" |
C:\cygwin\bin\perl.exe "C:\Program Files\SmartyPants\Smartypants.pl" |
C:\cygwin\bin\putclip.exe
(Note: this needs to be all on one line.)
As an aside, there’s no reason you couldn’t achieve the same using PHP Markdown and PHP SmartyPants (using php -q to prevent it from outputting HTTP headers).
I’ve put a shortcut in my start menu and assigned it a ‘shortcut key’, so to format a window full of text I can now press:
CTRL+A(select all)CTRL+C(copy)CTRL+SHIFT+M(Markdown+SmartyPants)CTRL+V(paste)
It seems a little long-winded when written out like that, but it’ll do for me.
Notes
- The Bicycle Cap
- What happens when a bicycle and a sewing m,achine get together. Brilliantly done!
- The Jesus Comic: telling the story of Jesus visually
- A useful-looking comic, presented as an iPhone app.
- Silent Monks Singing Halleluia
- Louis Vuitton Journeys
- Advert for a handbag (of all things!) involving US astronauts. Gorgeous image.
- Bitemybible: The Bible Style Guide
- An interesting, and useful, guide to the Bible aimed at journalists.
- The Alpha Course in Guernsey
- An opportunity to explore the meaning of life.