Comment preview
I added “live comment preview” as a wordpress plugin. It’s not the kind of preview that I’m used to — it shows the preview underneath the comment box as you type it. So it changes every time you type a new letter into your comment. I guess that’s what “live” means.
Syntax highlighter
I’ve just installed a syntax highlighter for showing code examples in this blog. It’s all written in javascript. Time for some tests:
// This is written in C++:
void
report_elapsed_time :: /* class */
stop( )
{
if ( is_started( ) ) {
report_( "ending test");
cancel( );
}
}
// This is written in JavaScript:
Triple = function( value, index, extra)
{
this.name = "zip"; /* name will change later */
this.value = value;
this.index = index;
this.extra = extra; /* save a little extra */
}
/*
** An example in CSS:
*/
table th,
table td
{ text-align : left; /* the default is center for th - and make this a long line*/
vertical-align : top ; /* middle (not center) and don't forget to make sure this comment is not too long */
padding-top : 2px ;
padding-bottom : 2px ;
}
Not bad. Notice the scrollbar under the last example because the lines are too long for the page.