Tag Archives: writing

How I Write Blog Posts

This is how I’m going to start writing blog posts.

vim on the left, Marked on the right

vim on the left, Marked on the right

The Problem With WordPress

Annoyingly, WordPress has lost a few of my posts now because it doesn’t really act as I would like it to.

Over the holidays I was at my partner’s parents’ house, and was happily typing away on my laptop. I’ve been writing up my findings of the web sockets “game” which turned into a fairly lengthy blog post (still working on it!). I was pretty happy that WordPress was occasionally telling me that it was auto-saving once in a while. I get called away for dinner, so I just close the lid of my laptop.

My state really should be saved at that point, right? That’s what you expect when you leave your computer – for the stuff you had on the screen to still be there. Unfortunately, that’s not what happen. I came back to the session expiring in WordPress, so I had to log in again. I went to find the draft post I was working on but it was missing a couple of paragraphs.

Thinking that auto-saving every few minutes is enough is just not cutting it. Every character I type is important, and each character I type should be saved. That might not be economical to do with AJAX though, so I can understand why WordPress avoided that solution. Similarly, localStorage isn’t good enough yet (at least that’s the last I heard of it).

Despite finding the WordPress writing UI really pleasant, this is fatal flaw that I can’t live with. The possibility of losing massive chunks of work is too high.

Using Vim and Marked

Whenever I’d write in WordPress I’d almost always use the Distraction Free mode – it strips out all of the UI, and leaves you with just a blinking cursor and the words “just write.” There are still some distractions with it however: my tabs for one thing, Facebook blinking at me telling me I’ve new messages.

vim on the overhand literally just has a blank, black screen and lets me type.

Of course, I could just use Notepad (or whatever OS X’s alternative is), but the opportunity to spend more time in vim is exciting for me. With IDE’s I’m using at work getting more bloated, the slim line text editor is looking more and more appealing, so I’m happy to be getting more experience. It’s true that coding and writing are different styles of keyboard usage, but being more comfortable with it can’t be a bad thing.

I like the idea of having most my posts’ content backed up outside of WordPress, in normal text files, too.

The problem, you might bring up, is that I lose the WYSIWYG editor. Not to worry though! I have Marked for that. Marked basically watches for changes in a file, and then renders the markdown for it. I love this. You can’t use Markdown in WordPress, which is a shame. Markdown really makes styling easier since I never have to reach for my mouse to go to some button to make the highlighted text into a link. I just wrap it in brackets, or add some asterisks for emphasis.

Typing code in WordPress was dire too. Going into the source view, wrapping <pre> tags around things (which WordPress would inevitably muck up). I don’t want to see HTML when I’m writing, I just want to write.

Getting it into WordPress

This is pretty simple too. Marked lets me copy the HTML of the view it’s rendered, and I just paste that into the source of the WordPress editor.

I do have to manage adding images into the posts within WordPress, but that’s not a bad experience at all.