BibleGateway.com Verse Of The Day

Wednesday, August 01, 2007

Making Code Pretty For The Web

Any time I post code to this stupid blog, I always run into the same issue. How to make it look like readable code? Seems that just putting code inside <PRE> tags doesn't seem to work -- something about the Google / Blogger engine mangles the crap out of the end if it gets "too long".

For Ruby at least, I just found this blog entry that helps out immensely. It's missing a step, as it assumes you have Rio already, but it was easy enough to figure out.
> gem install rio
> gem install syntax
Then save that Ruby script off locally and run it against your script file. Include the CSS or just add it to the HTML inside <STYLE> tags and you're golden.

Of course, the braindead Blogger engine doesn't seem to be picking up the stylesheet, so the code doesn't appear as pretty as it should -- no syntax coloring or anything. I'll have ot figure that out before I post my HTTP load runner script.

No comments: