support for python and shellscript
authorkramm <kramm>
Tue, 1 Apr 2008 16:14:10 +0000 (16:14 +0000)
committerkramm <kramm>
Tue, 1 Apr 2008 16:14:10 +0000 (16:14 +0000)
doc/codebeautifier.pl

index 517bd69..169b23c 100644 (file)
@@ -1,3 +1,4 @@
+$nr = 1;
 while(<stdin>)
 {
     if(/\[CALLPERL\s+(.*)\s+left\]/ ... /\[CALLPERL end\]/) {
@@ -28,6 +29,18 @@ while(<stdin>)
        print;
        unlink "tmp.sc";
     }
+    elsif ($code ne "" && ($lang eq "python" or $lang eq "shell")) {
+       $code =~ s/&quot;/"/g;
+       if($lang eq "python") {
+          open(fi, ">$nr.py");print fi $code;close(fi);
+           $nr = $nr + 1;
+       }
+       print "<td bgcolor=\"#ffffff\" width=\"$width\">";
+       print $embed;
+       print "</td>";
+       $code="";
+       print;
+    }
     elsif ($code ne "") {
        $code="";
     }