Posts tagged bundle

Jun 25, 2007

More TextMate dates for your WordPress blog

TextMate WordPress blogging bundle TextMate WordPress blogging bundle | comments

Previously I posted what amounts to a link post about how TextMate can be hacked to help you write blog entries for WordPress. I really did not take that post far enough. Once you have the TextMate environment set up, ala the TextMate wiki, then you need to get your timezone just right.

The TextMate blogging bundle has a built-in snippet for specifying the date (simply type “date” then the tab key). Unless you are in the GMT time zone, you’ll need to offset that date. For instance, currently in the central time zone I need to offset the date by -0500 hours.

Rather than type in that offset every time you include the date in your blog post, why not just update the snippet to do the work for you?

Blogging Date Snippet

With the TextMate blogging bundle, if you do not specify a date as you construct your post, it will default to the current date and time when you submit the post to your blog. The beauty is that the blogging bundle draws that date format from the snippet you updated above. So even posts with non-specific dates get set correctly for your timezone.


May 30, 2007

Installing HAML bundle for TextMate

bundle haml sass textmate | comments

There is currently a TextMate bundle in process for the templating language, Haml. It doesn’t come built-in, however. Installation is fairly simple once you figure it out.

(Keep in mind, my TextMate application location may vary from yours. This is simply what I found works for me.)

First, browse to your bundles area in Terminal. You may need to create some of these directories on your system.

cd ~/"Library/Application Support/TextMate/Pristine Copy/Bundles/"

Then check out the TextMate bundle from MacroMates' bundle repository:

svn co "http://svn.textmate.org/trunk/Bundles/Ruby Haml.tmbundle"

Or if you prefer git:

git clone git://github.com/textmate/ruby-haml.tmbundle.git

Then, reload your bundles in TextMate (Bundles | Bundle Editor | Reload Bundles).

Finally, for some reason tabbing isn’t set properly by default when editing a Haml file, which is important for this white-space-aware templating language. Perhaps the expectation is that you will always use your space bar? In any case, after opening a .haml file, look along the bottom bar of the TextMate interface. Be sure the Haml bundle is selected, and change your tabbing to Soft Tabs at 2 spaces per tab.

Haml tabbing

Update: Here are instructions for installing the Sass TextMate bundle:

cd ~/"Library/Application Support/TextMate/Pristine Copy/Bundles/"
svn co "http://macromates.com/svn/Bundles/trunk/Review/Bundles/Ruby Sass.tmbundle"

For both the Haml and Sass bundles, you may prefer to install the bundles in your “personalized” bundle area. Simply replace the cd commands above with:


Apr 30, 2007

Specifying date when blogging from TextMate to WordPress

TextMate WordPress blogging bundle TextMate WordPress blogging bundle | comments

Friday was a day of Mac-fu. I spent the entire day getting more familiar with some tools and attempting to automate various repetitive tasks. I didn’t get very far, unfortunately, but the groundwork has been laid. OS X rocks.

TextMate is an amazing editor with amazing bundles snapped on to it. One of these bundles is for blogging. Why do I hop to my browser to blog when I have a glorious text editor right on my desktop that will accept Markdown formatting, grab categories directly from my blog, and upload pictures with a drag and a drop on the page?

The biggest problem I have with TextMate blogging is date stamping. I could throw an alternative date on my post pre-submission and it just was not recognized by WordPress. Something was lost in translation. Wiki-support to the rescue! TextMate fixes the problem fairly simply for me.

Note: I did receive an error when executing the provided patch against WordPress’s xmlrpc.php file:

patching file xmlrpc.php
Hunk #1 succeeded at 692 with fuzz 1 (offset 23 lines).
Hunk #2 FAILED at 763.
1 out of 2 hunks FAILED -- saving rejects to file xmlrpc.php.rej