Sunday, October 22, 2006

Vim-Blogger Featuring Markdown

Yes I'm still playing with this vim-blogger plugin. Now it has the ability to allow you to compose your post using John Gruber's Markdown syntax instead of plain ol' ugly html :). To accomplish this task, I am using a Python module for the conversion to HTML when posted.

Also cool is the fact that when a post is retrieved from your blog using this plugin, it is converted back to Markdown syntax using html2text. I think this is pretty cool. Here is a screenshot of me composing this post:

Vim-BloggerBeta with Markdown

As you can see, I have a Vim syntax file for Markdown files too. I've modified it a bit to include vim-blogger specific things like the @@LABELS@@ line at the bottom etc. I do plan on making a release of this plugin at some point soon. It's too buggy just yet though. When I do, it will be composed of multiple files including the markdown and html2text Python modules, the syntax files, an ftplugin directory, and a regular (small) blogger.vim plugin file.

Using Markdown syntax has both advantages and disadvantages. The biggest advantage is the fact that it is easier to read and write when compared to HTML code. Also, it is rapidly becoming a popular method of writing structured text. A disadvantage is that the syntax still has some weaknesses. For example as of now there is no way to specify the size of an embedded image and there's no way to make it float right or left in your text. This can be done with embedded HTML, but then it would get messed up during the conversion back to Markdown in the context of this Vim plugin. For now though, it's fun to play with :).

No comments:

Post a Comment