Hack: GeSHi Code Highlighting

MasterBlaster
https://github.com/GeSHi/geshi-1.0


Here is how you can quickly add GeSHi code highlighting to your Wacko installation:

  1. cd formatter/highlight/
  2. wget https://github.com/GeSHi/geshi-1.0/archive/RELEASE_1_0_8_12.tar.gz
  3. tar xzvf GeSHi-1.0.7.1.tar.gz
  4. rm GeSHi-1.0.7.1.tar.gz
  5. mkdir old; mv {css,html,java,pascal,php,sql}.php old/ Get rid of older support.
  6. Build a list of names of GeSHi files, I did this with ls geshi/geshi -1 | awk -F. '{print $1}' > names
  7. You might want to open up names and change html4strict to just html.
  8. Run the below script in that directory, change as needed.
  9. You can then do things like %%(perl) %% and it will work more or less as expected.
  10. This is intended to get you there quickly, you may want to extend this further on your own.

#!/bin/sh

for x in `cat names`; do

cat < $x.php
set_header_type(GESHI_HEADER_DIV);
\$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
\$geshi->set_tab_width(4);
echo "";
echo "<div class="\"code\"">";
echo \$geshi->parse_code();
echo "</div>";
echo "";
?>
EOF

done