WordPress.com Syntax Highlight Without Plugins

As you can maybe see from my previous post, I’ve got my syntax highlighted. There is no plugin working its magic behind it, infact, since I’m not hosting this blog myself, I can’t use plugins at all. Nevertheless, one solution for highlighting syntax is to ‘wrap’ it with html, which works with the wordpress posts. I found out that with gVim you can Syntax->Convert to HTML. With gVim you need to use the “:TOhtml” user command. All you need to do is copy the output into you post. You might want to make the font size something like 3 by adding size=”3″ into <font face=”monospace”> which is in the beginning of the output – <font face=”monospace” size=”3″>. If you know some other/better way to do this please comment. Hope this helps 😀

Advertisements

4 Responses to “WordPress.com Syntax Highlight Without Plugins”


  1. 1 Dirk Gently February 24, 2008 at 3:19 am

    very nice. I’m guessing when stating Vim that means Gvim? I am unaware of a method that can do this in regular vim.

  2. 2 morphex February 25, 2008 at 12:19 pm

    Yeah it’s gVim, I’ll edit the post. Thanks for commenting 😀

  3. 3 iroel April 15, 2008 at 7:05 am

    Hi, nice post. I republished this article in Indonesian. I add a tag to limit the width of source code n tag to ignore the long line source code. I also use style=”overflow:auto; width:100%” to arrange the source code apperance. I use gVIm too, but Notepad++ is also possible. You can see my article in http://www.iroel.web.id/portable-windows-dns-server-for-windows.htm, if you don’t like, I can remove it

    iroel
    Y!M rilvo

  4. 4 morphex April 15, 2008 at 3:15 pm

    Cool 😀
    “style=”overflow:auto; width:100%” to arrange the source code apperance.”
    – that’s good to include.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s





%d bloggers like this: