cvs: pres2 / objects.php
| From: | Sterling Hughes | Date: | Sun, 10 Aug 2003 23:08:13 +0000 |
| Subject: | cvs: pres2 / objects.php | ||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-814@lists.php.net to get a copy of this message | ||
sterling Sun Aug 10 19:08:13 2003 EDT
Modified files:
/pres2 objects.php
Log:
guess type in default case
Index: pres2/objects.php
diff -u pres2/objects.php:1.144 pres2/objects.php:1.145
--- pres2/objects.php:1.144 Sun Jun 22 01:22:00 2003
+++ pres2/objects.php Sun Aug 10 19:08:12 2003
@@ -119,6 +119,7 @@
|rrggbb|word| Colour a word
^N^ Superscript
@N@ Subscript
+ #id# Entity
*/
function markup_text($str) {
$ret = $str;
@@ -1050,9 +1051,22 @@
// {{{ highlight()
function highlight() {
global $slideDir;
+ static $temap = array(
+ 'py' => 'python',
+ 'pl' => 'perl',
+ 'php' => 'php',
+ 'html' => 'html',
+ 'sql' => 'sql',
+ 'java' => 'java',
+ 'c' => 'c'
+ );
if(!empty($this->filename)) {
$_html_filename = preg_replace('/\?.*$/','',$slideDir.$this->filename);
+ if ($this->type == 'php') {
+ $p = pathinfo($this->filename);
+ $this->type = $temap[$p['extension']];
+ }
switch($this->type) {
case 'php':
case 'genimage':
@@ -1097,9 +1111,9 @@
}
break;
case 'python':
- $prog = trim(
which py2html);
+ $prog = trim(which code2html);
if (!empty($prog)) {
- print $prog -stdout -format:rawhtml $_html_filename;
+ print nl2br(trim($prog -lpython --no-header -ohtml $_html_filename | sed -e
's/\t/\ \;\ \ \; /'));
} else {
$this->_highlight_none($_html_filename);
}
@@ -1107,7 +1121,9 @@
case 'sql':
$prog = trim(which code2html);
if (!empty($prog)) {
+ print "<pre>";
print $prog --no-header -lsql $_html_filename;
+ print "</pre>";
} else {
$this->_highlight_none($_html_filename);
}