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:

  1. 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.

    ReplyDelete
  2. 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

    ReplyDelete
  3. 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.

    ReplyDelete
  4. Thanks Alex.

    I updated it so it only loads the necessary files.

    ReplyDelete
  5. 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

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. thanks for the link glad my post helped

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

    ReplyDelete