< Previous | [Index] | Next >
# place all content into the $content var, then: $content =~ s/(<pre class="perlcode">)(.+?)(<\/pre>)/ "$1\n" . code2html($2) . "\n$3" /gse; sub code2html { my $code = shift; my $syntax = Text::VimColor->new( vim_command => '/bin/vim', string => $code, filetype => 'perl', ); my $html = $syntax->html; for ($html) { s/^\s+//s; s/\s+$//s; } return $html; }
Offer Kaye.
Slides automatically generated by tmpl2slides.pl. Last updated on Sun Dec 5 01:43:31 2004