Thursday, December 08, 2005

Testing Formats

I'm trying to determine how easy it is to add code snippets in a decent format, so here goes and see how the style sheet handles it:

pre:

public static void ReadOut(string text)
{
// read out the text
}



code:

public static void ReadOut(string text)
{
// read out the text
}


from the preview it looks like pre wins (to be expected since it maintains the spaces.

(notes - couldn't tab while in the blogger editor - I imagine you can copy and paste them tho)

I did some searching and found a couple of promising tools but they require uploading of .net libraries, http://www.misterdotnet.com/blog/?page_id=360. It would be great if blogger had some code highlighting css libraries that everyone could use.

I tried using pre on the notify post but it seems the style sheet with the pre formatting is not backward compatible. Correction - its just the previewer that doesn't pick up the style sheet.

Here is the pre I am using currently:

pre, code {
font-size: 100%;
font-family: monospace;
background-color: buttonface;
border: 1px dashed gray;
}

pre {
padding: 0px 5px 20px 5px;
margin: 10px 5px 10px 15px;
overflow: auto;
width: 95%;
behavior: url(pre.htc);
line-height: 100%;
}

taken from http://evolt.jeffhowden.com/jeff/code/modified_pre_blocks/index.cfm

0 comments: