Monday, January 19, 2009

Syntax highlighting woes

I am having some trouble with the setup of my posts.
I want the perl scripts that I publish to use the same syntax highlighting that you get in Notepad++.
So I used the NppExport plugin of Notepad++ and exported to a .html document (tried to a .rtf file also).
I copied and pasted the html code from the created html file to the WYSIWYG editor of blogger but the text formating has disappeared and I end up with something like that:

#!/usr/bin/perl
use warnings;
print "This is not so easy";

Then I tried to copy the html code from the exported html file into the "Edit Html" tab of the editing window but it doesnt work any better.

I have googled syntaxhighlighter but it doesn't support the Perl syntax. Somebody was nice enough to create a Perl extension. So I'll be trying it out in the next few hours. I will try re-publishing yesterday's post so don't go thinking that your feed reader has gone crazy.
And sorry for the inconvenience, I'm learning here ;)

French word of the day:
"J'apprends": I am learning

1 comment :

  1. I figured it out!
    After much googling, I finally have a nice syntax highlighter for Perl code: see how I rewrote the post below:
    http://damienlearnsperl.blogspot.com/2009/01/perl-template-part-i-basics.html

    ReplyDelete