Scott Penrose

TestPre

Scott is an expert software developer with over 30 years experience, specialising in education, automation and remote data.

Difference between revision 6 and current revision

No diff available.

Simple Pre
#!Perl
my $frog = 1;
my $dog = 3;
if ($frog < $dog) {
   $frog->$dog($frog - $dog);
}

Less than <
Greater than >
Ampersand &

The actual code...

use Syntax::Highlight::Engine::Kate;

$ModulesDescription .= '<p>XXX</p>';

push(@MyRules, \&PreRule);
$RuleOrder{\&PreRule} = -20;

my $syntax_hl = new Syntax::Highlight::Engine::Kate(
        language => 'Perl',
        substitutions => {
                "<" => "&lt;",
                ">" => "&gt;",
                "&" => "&amp;",
                #" " => "&nbsp;",
                #"\t" => "&nbsp;&nbsp;&nbsp;",
                #"\n" => "<br/>\n",
        },
        format_table => {
                Alert => ["<font color=\"#0000ff\">", "</font>"],
                BaseN => ["<font color=\"#007f00\">", "</font>"],
                BString => ["<font color=\"#c9a7ff\">", "</font>"],
                Char => ["<font color=\"#ff00ff\">", "</font>"],
                Comment => ["<font color=\"#7f7f7f\"><i>", "</i></font>"],
                DataType => ["<font color=\"#0000ff\">", "</font>"],
                DecVal => ["<font color=\"#00007f\">", "</font>"],
                Error => ["<font color=\"#ff0000\"><b><i>", "</i></b></font>"],
                Float => ["<font color=\"#00007f\">", "</font>"],
                Function => ["<font color=\"#007f00\">", "</font>"],
                IString => ["<font color=\"#ff0000\">", "<//font>"],
                Keyword => ["<b>", "</b>"],
                Normal => ["", ""],
                Operator => ["<font color=\"#ffa500\">", "</font>"],
                Others => ["<font color=\"#b03060\">", "</font>"],
                RegionMarker => ["<font color=\"#96b9ff\"><i>", "</i></font>"],
                Reserved => ["<font color=\"#9b30ff\"><b>", "</b></font>"],
                String => ["<font color=\"#ff0000\">", "</font>"],
                Variable => ["<font color=\"#0000ff\"><b>", "</b></font>"],
                Warning => ["<font color=\"#0000ff\"><b><i>", "</b></i></font>"],
        },
);