More testing code layout May 19, 2009

Well, I pinged an email to the nice support guys at WordPress.com about whether I had missed something about turning off the gutter (line numbering) from the sourcode view, but there is no flag I missed and no mention was made of it coming in the future. I also am a little concerned that using sourcecode slows down the rendering of the web page. So I might save it for special code.

I also found out that if your code sample is more than about 60 characters long, you exceed the width of the text area and get scroll bars to the bottom and side (not of course helped by not being able to suppres the line numbering):

Like this:

Related

My standard (prior to the “sourcecode” tag) was to use the “pre” and “code” tags in that order. But I also spent about half a day trying to find a theme which didn’t make a mess of them. Rubric seemed to be the only theme that behaved reasonably well.

A problem I’ve found with the “sourcecode” tag is that it has made a mess of my tab marks.

I think the theme is also an issue. I like the one I’ve chosen for it’s general layout but the text area is not quite wide enough and it seems impervious to font and font size tags, which would be very nice for laying out code. I might have a play with others and see if there is a better option.

When I wrap text with sourcecode I am now torn between making it look nicely laid out in the sourcecode box (as you say, tabs are messed up and runs of spaces tend to go a little wrong) or preserve the flat ascii spacing, so that when you click the “view plain” button it looks right. That could be especially important for scripts I put up, but maybe I will stick to just putting scripts elsewhere on the net and linking through to them – otherwise I’ll end up spending all my life laying out blogs than doing real work.