jump to navigation

More testing code layout May 19, 2009

Posted by mwidlake in Blogging.
Tags:
2 comments

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.

Testing code layout May 18, 2009

Posted by mwidlake in Blogging.
Tags:
4 comments

Well, as a new blogger, I am having the usual issues everyone does – with layout. Specifically, code. Code takes up space and it looks best if it is in a fixed font. I can’t see an option to set the font for specific parts of the text, so I need to use tags I guess. So let us try.

Piet de Visser gave me a couple of hints

First, I shall use the code tag

 test102>select a.result-b.result
  2  from (select max(pers_id)+1 result,1 eric from person) a
  3  ,(select min(pers_id) result,1 eric from person) b
  4  where a.eric=b.eric
  5  /

Hmm, it looks fine in the box I enter my text in, a nice small courier font. But now you are looking at it on the published page, it is in larger text and in a shaded box. The shaded box is nice, the large text is a pain. Code tend to be long, based on 80 characters per line or more.

Let’s try sourcode with language=’sql’ (sourcecode uses square brackets not angle brackets)

  test102>select a.result-b.result
  2  from (select max(pers_id)+1 result,1 eric from person) a
  3  ,(select min(pers_id) result,1 eric from person) b
  4  where a.eric=b.eric
  5  /

Now, that is more like it but the addition of the line numbers is a duplication, I will have to edit all my sql*plus output to get rid of it. Can I just have the layout with the code structure highlighting?…

  test102>select a.result-b.result
  2  from (select max(pers_id)+1 result,1 eric from person) a
  3  ,(select min(pers_id) result,1 eric from person) b
  4  where a.eric=b.eric
  5  /

Whoops, it demands a language, so that it can parse out and highlight the syntax. At least you can see the kind of syntax used though. Check out This note by wordpress on what they suggest. This link here says something about the underlying javascript but I guess wordpress have wrapped this feature as they don’t support javascript (as otherwise some swine would abuse it to damage the site). A shame as I would like to turn off the line numbering. Hmmm, I tried a few things like the below but no luck:

test102>select a.result-b.result
2 from (select max(pers_id)+1 result,1 eric from person) a
3 ,(select min(pers_id) result,1 eric from person) b
4 where a.eric=b.eric
5 /

I’ll see if using the direct syntax works, I expect not…

<pre name=”code” class=”sql”
test102>select a.result-b.result
2 from (select max(pers_id)+1 result,1 eric from person) a
3 ,(select min(pers_id) result,1 eric from person) b
4 where a.eric=b.eric
5 /</code>

No.

So, if I edit my text a little and use the sourcecode language=’sql’ tag…

select a.result-b.result
from (select max(pers_id)+1 result,1 eric from person) a
     ,(select min(pers_id) result,1 eric from person) b
where a.eric=b.eric
/

Well, it is OK but it does not show it in fixed font in the post but you can click on the option to do so. It is a shame that it is not possible to set the simple (what looks like courier) text to be used in the formatted box via a flag or something.

I could pay for the CSS feature, that would probably make all of this easier.

What can I achieve with changing font size? I Looked here for some instructions.
In the below I try and use font size=n tags…

eric eric eric
eric eric eric
eric eric eric

but it does not work.
How about span? font is, after all, depricated…

eric eric eric

No. No luck. Span is not working for me either. Maybe it is my theme that does not allow it.

OK, enough on that and back to the day job. I now know I can improve the layout but I’d like to be able to do more… I guess I could sell the cat to science and buy the upgrade? :-)

Follow

Get every new post delivered to your Inbox.

Join 180 other followers