jump to navigation

More testing code layout May 19, 2009

Posted by mwidlake in Blogging.
Tags:
trackback

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):

select count(*) "Invalid count:" from dba_objects where status != 'VALID';
select substr(owner,1,14) ownr
,substr(object_name||' - '|| object_type,1,36) obj_name
,to_char(created,'DD-MON-YY') CREATED
,to_char(last_ddl_time,'ddmmyy hh24:mi') last_ddl
from dba_objects where status !='VALID'
order by 1,2
/

compared to:

select count(*) "Invalid count:"
from dba_objects where status != 'VALID';
select substr(owner,1,14) ownr
,substr(object_name||' - '|| object_type,1,36) obj_name
,to_char(created,'DD-MON-YY') CREATED
,to_char(last_ddl_time,'ddmmyy hh24:mi') last_ddl
from dba_objects where status !='VALID'
order by 1,2
/

But the nice support desk person did suggest I try pre tags;

select count(*) "Invalid count:"
from dba_objects where status != 'VALID';
select substr(owner,1,14) ownr
,substr(object_name||' - '|| object_type,1,36) obj_name
,to_char(created,'DD-MON-YY') CREATED
,to_char(last_ddl_time,'ddmmyy hh24:mi') last_ddl
from dba_objects where status !='VALID'
order by 1,2
/

Hmmm, nope, not really better than code.
I am starting to think I duffed slightly in chosing this style, Regulus. I suspect it does not respond to many formatting tags.

On the plus side, the nice helpdesk person did agree to putting the issue of access to the flags for sourcecode on the list of requested enhancements. Nice people.

About these ads

Comments»

1. Jonathan Lewis - May 27, 2009

Martin,

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.

mwidlake - May 27, 2009

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.


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

Follow

Get every new post delivered to your Inbox.

Join 152 other followers

%d bloggers like this: