Tuesday, November 03, 2009

Testing Syntax highlighting

I found following blog post which explains how to include SyntaxHighligther (v2) in blogger.

So lets give it a try for the languages I use most.

SQL


SELECT ename, empno
FROM emp
WHERE empno = 7654;

PL/SQL (same highlighting as SQL)

BEGIN
FOR r in (SELECT ename, empno
FROM emp)
LOOP
htp.p(r.ename);
END LOOP;
END;

JavaScript

$(document).ready(function() {
$(".btn-download").click(function(){
callMyFunction();
});
});

XML





















8 comments:

Mathias said...

Only problem is that it does not work for those who reads the blogs they are interested in via RSS. Your post made little sense before I clicked on "Show original item". Just something to keep in mind as most readers uses an rss reader these days.

Dimitri Gielis said...

Thanks for highlighting that.

Before I took screenshots, which worked nicely too, but it's much harder for people to copy the code in that way.

I'll try to mention it in the beginning of my post where I use it.

Thanks,
Dimitri

suPPLer said...

Hi! Sorry for my English, sometimes it's horrible. :)

There is one little remark. Are you really going to use SyntaxHighlighter Brushes for PHP, Ruby, C++ and others? Looking on Firebug's Net tab I see all this stuff that will never be used. What about to only load those brushes, that you mention: SQL, JavaScript, XML?

And one more: Dimitri, thanks a lot for your blog, it`s amazing, interesting, helpful!

With the best wishes,
Alex.

Dimitri Gielis said...

Thanks Alex.

I updated it so it only loads the necessary files.

Martin D'Souza said...

Hi Dimitri,

I use the Syntax Highlighter for my blog and have the same issue for RSS feeds. I don't know if there's a work around for it...

Martin

suPPLer said...
This comment has been removed by the author.
Unknown said...

thanks for the link glad my post helped

Unknown said...

glad my post could help! yea i have a problem with the rss too i wish it could fail gracefully...