Arsalan's Musings on Software

Software design and development techniques, ideas, and source code snippets…

WordPress makes posting source code to your blog easy

with one comment

When I decided to start a blog to post source code for small projects, I needed a blogging platform that would make posting source code with keyword highlights, line numbers, and proper indentation a snap. After a bit of search and general disappointment with blogging systems, I came across the wonderful feature in WordPress that let’s you post beautifully styled source code simply by enclosing the code inside the SourceCode tag! And that was all I had to do! Brilliant!

The only caveat I found so far is that the view seems fixed in width. So you have to choose a theme that gives you more space in the main text area. If a line in your code is longer than what the template allows, you will get a horizontal scroll bar. However, if you scroll right to see the overflowing code, you will notice that the alternating background color scheme does not apply there. Clearly a bug and a big disappointment. I hope some body at WordPress sees this post and removes that defect. This is still the best and easiest way to date to showcase your source code in a blog.

Here is the FAQ for WordPress.

Happy coding!

Advertisements

Written by Arsalan A.

January 6, 2008 at 3:31 pm

Posted in 1

One Response

Subscribe to comments with RSS.

  1. Thank you for the sharing this coolness with me. After getting inspired from your posted code I have moved my dev blog to wordpress. WordPress has some awesome features like importing blog posts and comments from blogger which I used to transfer my blog from http://saaridev.blogspot.com to http://saaridev.wordpress.com.

    Now I having fun with :

    
    

    and yes they are square brackets not angle brackets

    imsaar

    January 7, 2008 at 11:41 pm


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: