DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:geshi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
devel:geshi [2013-05-04 19:38]
Klap-in [Example usage]
devel:geshi [2013-12-10 12:31] (current)
109.195.194.200 [Example usage]
Line 5: Line 5:
  
 Please refer to the [[xref>​GeSHi]] class documentation for implementation details. Please refer to the [[xref>​GeSHi]] class documentation for implementation details.
 + 
 ===== Example usage ===== ===== Example usage =====
 Example how DokuWiki applies the highlighter for its code and file blocks. It is embedded in a wrapper method [[xref>​p_xhtml_cached_geshi]] that caches the output to reduce the server load. Example how DokuWiki applies the highlighter for its code and file blocks. It is embedded in a wrapper method [[xref>​p_xhtml_cached_geshi]] that caches the output to reduce the server load.
  
 <code php> <code php>
-$code = '​...syntax to higlight...';​+$code = '... syntax to higlight ...';
 $geshi = new GeSHi($code,​ $language, DOKU_INC . '​inc/​geshi'​);​ $geshi = new GeSHi($code,​ $language, DOKU_INC . '​inc/​geshi'​);​
 $geshi->​set_encoding('​utf-8'​);​ $geshi->​set_encoding('​utf-8'​);​
Line 28: Line 28:
   * [[wiki:​syntax#​syntax_highlighting|Syntax highlighting]] in ''​%%<​code>​%%''​ and ''​%%<​file>​%%''​ blocks   * [[wiki:​syntax#​syntax_highlighting|Syntax highlighting]] in ''​%%<​code>​%%''​ and ''​%%<​file>​%%''​ blocks
   * [[tips:​GeSHi style builder]] for generating smaller css files by using similar colors for the different languages.   * [[tips:​GeSHi style builder]] for generating smaller css files by using similar colors for the different languages.
 +  * [[tips:code css|CSS to extend syntax highlighting ]]
devel/geshi.1367689122.txt.gz ยท Last modified: 2013-05-04 19:38 by Klap-in