Loading...
 
Skip to main content

Features / Usability


You are viewing a reply to Aw: GeSHi as a Wiki plugin

Re: Aw: GeSHi as a Wiki plugin

>
> Hi, I'm using this solution for my work:
> ...
> This solution works fine for HTML-Output. However with PDF I get bad results.
>
> Regards
>
> JMan

JMan, thanks for posting this enhancement. I modified your snippet to also implement the line numbering option with geshi, and force links to open in new windows. Hopefully, this will be useful to others.

Copy to clipboard
if (isset($colors)) { include_once ('lib/geshi.php'); $w_geshi = new GeSHi(decodeHTML(trim($code)), $colors, ''); $w_geshi->set_header_type(GESHI_HEADER_NONE); $w_geshi->set_link_target("_blank"); if (isset($ln) && $ln ==1) { $w_geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); } $out.= "".$w_geshi->parse_code().""; } else { if (isset($wrap) && $wrap == 1) { ...


I also opted to copy geshi.php and the /geshi subdirectory under /lib instead of the main tikiwiki directory, just my preference.