blog syntax highlighting
First the bad news. At some point last week all code previously posted here suddenly had all its comments converted into upper case π¦
Now the good news. While looking into why WordPress syntax highlighter was suddenly doing this I re-tested to see if Perl had been added and lo and behold it had!
This is how a previous code looked using “ruby”:
# sourcecode lang="ruby" { package Anonyject; use MooseX::SingletonMethod; } my @dingfirsts; for my $line ( 1..10 ) { push @dingfirsts, Anonyject->new->add_singleton_methods( ding => sub { 'ding' x $line }, dong => sub { 'dong' x $line }, line => sub { $line }, ) } for (@dingfirsts) { say "First ", $_->ding, " on line ", $_->line; }
Now Perl works!:
# sourcecode lang="perl" { package Anonyject; use MooseX::SingletonMethod; } my @dingfirsts; for my $line ( 1..10 ) { push @dingfirsts, Anonyject->new->add_singleton_methods( ding => sub { 'ding' x $line }, dong => sub { 'dong' x $line }, line => sub { $line }, ) } for (@dingfirsts) { say "First ", $_->ding, " on line ", $_->line; }
WordPress must have updated this plugin last week. Hopefully they’ll fix the comment issue soon π
Anyway the Perl code is so much nicer. The Ruby sigil variables were in bold which wasn’t nice on the eye. I’ll be updating all my previous posts to now use Perl highlighting very shortly.
/I3az/
Nice to hear that. Now we just need a gist plugin!
Yes looking forward to when WordPress add the Gist plugin to their hosted accounts (hey… they may have sneaked it in… I didn’t check!).
BTW… I like the font & colours used in the Github/Gist syntax highlighting so much I manually setup the same settings with Textmate on my Mac π
/I3az/