devel:geshi
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
devel:geshi [2013-05-04 21:30] – [Example usage] Klap-in | devel:geshi [2023-09-16 00:44] (current) – Klap-in | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | |||
====== Syntax highlighting by Geshi ====== | ====== Syntax highlighting by Geshi ====== | ||
DokuWiki includes GeSHi - Generic Syntax Highlighter - for formatting '' | DokuWiki includes GeSHi - Generic Syntax Highlighter - for formatting '' | ||
Line 5: | Line 4: | ||
Please refer to the [[xref> | Please refer to the [[xref> | ||
+ | |||
===== Example usage ===== | ===== Example usage ===== | ||
- | Example how DokuWiki applies the highlighter for its code and file blocks. It is embedded in a wrapper method [[xref> | + | Example how DokuWiki applies the highlighter for its code and file blocks. It is embedded in a wrapper method [[xref> |
<code php> | <code php> | ||
- | $code = ' | + | $code = '... syntax to higlight ...'; |
- | $geshi = new GeSHi($code, | + | $geshi = new GeSHi($code, |
$geshi-> | $geshi-> | ||
$geshi-> | $geshi-> | ||
Line 17: | Line 16: | ||
$geshi-> | $geshi-> | ||
- | // when you like to use your own wrapper, remove GeSHi' | + | //when you like to use your own wrapper, remove GeSHi' |
- | // we need to use a GeSHi wrapper to avoid <BR> throughout the highlighted text | + | //we need to use a GeSHi wrapper to avoid <BR> throughout the highlighted text |
$highlighted_code = trim( | $highlighted_code = trim( | ||
- | preg_replace(' | + | preg_replace(' |
" | " | ||
); | ); |
devel/geshi.1367695856.txt.gz · Last modified: 2013-05-04 21:30 by Klap-in