Tuesday, October 30, 2007

Format your Code for Blogger

Finally, I found a solution of how to easily format my Source Code examples for Blogger. I've seen many examples of how other blog services handle this, such as Wordpress, but I don't use Wordpress...

Here is how to easily do this, until Blogger comes up with an easier way:

Copy your source code example and paste it into this page:

Source Code Formatter for Blogger

Click on the "Format Code" button and copy the results.

Switch to "Edit Html" view in your Blogger Edit Post page and paste in the formatted code example.

Here is what a sample PL/SQL example would looks like:

BEGIN
FOR cur IN (select id from test)
LOOP
UPDATE table SET column = "DONE" WHERE id = cur.id where;
COMMIT;
END LOOP;
END:
/

Thanks to Greg Houston for this simple solution.