Blogging with Textmate
Monday, February 26, 2007 Mr Interested
I picked up Textmate for HTML and Rails coding a while back and have been learning about its wonders ever since. It’s a great editor for code, certainly, but it’s so much more. Witness this post being written in Textmate.
The first picture shows how to create a new document based on a template:
(If you don’t know about Textile, check it out) This gets me a pretty basic window:
Next picture shows how to set up Textmate to post to your blog. I’m using Wordpress so XML-RPC is built in, making all this a snap:
Here’s the text file to edit - it’s all pretty self explanatory:
After all that’s taken care of, I’m ready to go with the post writing. Note, by the way, that all the images for this post have been simply dragged from my desktop into the blog window. Textmate handles the upload and linking. Sweetness!
There’s a blue “cut line” in the base template – I took that out. Here’s a screen shot of the nearly complete post:
I’m going to wrap this up now. Selecting the text of this post, I convert it to HTML with the keys Control-Shift-H. Pressing Control-Command-P sends this post on its way.
Note: this process isn’t perfect. With a post that has images, you might need to monkey with the post (set widths etc.) because the image upload feature doesn’t create thumbnails and link, as Wordpress does. I went through and hand edited the page after posting to make things look a little nicer (down-scaling the full size pictures), but the user is still downloading the full images when they load this page. There are other issues as well, but the point of this post is that for normal tasks using Textmate offers an easy to use and streamlined workflow for posting to blogs. Another victory for Textmate.
Also note that the Textmate “bundles“ that do all the work behind the scenes are written in Ruby and are editable. That means that if I wanted to change it so that images were uploaded with thumbnails and linked, I could do so. Here’s how:
I’ll post the modified snippet if I a) find that nobody else has already done this and b) find enough time and motivation to do it myself.






