1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
5 <!-- template designed by Marco Von Ballmoos -->
6 <title>Docs for page geshi.php</title>
7 <link rel="stylesheet" href="../../media/stylesheet.css" />
8 <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
11 <div class="page-body">
12 <h2 class="file-name"><img src="../../media/images/Page_logo.png" alt="File" style="vertical-align: middle">/geshi.php</h2>
14 <a name="sec-description"></a>
15 <div class="info-box">
16 <div class="info-box-title">Description</div>
18 <span class="disabled">Description</span> |
19 <a href="#sec-classes">Classes</a>
20 | <a href="#sec-constants">Constants</a>
21 | <a href="#sec-functions">Functions</a>
23 <div class="info-box-body">
24 <!-- ========== Info from phpDoc block ========= -->
25 <p class="short-description">GeSHi - Generic Syntax Highlighter</p>
26 <p class="description"><p>The GeSHi class for Generic Syntax Highlighting. Please refer to the documentation at http://qbnz.com/highlighter/documentation.php for more information about how to use this class.</p><p>For changes, release notes, TODOs etc, see the relevant files in the docs/ directory.</p><p>This file is part of GeSHi.</p><p>GeSHi is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</p><p>GeSHi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p><p>You should have received a copy of the GNU General Public License along with GeSHi; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</p></p>
28 <li><span class="field">author:</span> Nigel McNie <<a href="mailto:nigel@geshi.org">nigel@geshi.org</a>>, Benny Baumann <BenBE@omorphia.de></li>
29 <li><span class="field">copyright:</span> (C) 2004 - 2007 Nigel McNie, (C) 2007 - 2008 Benny Baumann</li>
30 <li><span class="field">filesource:</span> <a href="../../__filesource/fsource_geshi_core_geshi.php.html">Source Code for this file</a></li>
31 <li><span class="field">license:</span> <a href="http://gnu.org/copyleft/gpl.html">GNU GPL</a></li>
37 <a name="sec-classes"></a>
38 <div class="info-box">
39 <div class="info-box-title">Classes</div>
41 <a href="#sec-description">Description</a> |
42 <span class="disabled">Classes</span>
43 | <a href="#sec-constants">Constants</a>
44 | <a href="#sec-functions">Functions</a>
46 <div class="info-box-body">
47 <table cellpadding="2" cellspacing="0" class="class-table">
49 <th class="class-table-header">Class</th>
50 <th class="class-table-header">Description</th>
53 <td style="padding-right: 2em; vertical-align: top; white-space: nowrap">
54 <img src="../../media/images/Class.png"
57 <a href="../../geshi/core/GeSHi.html">GeSHi</a>
68 <a name="sec-constants"></a>
69 <div class="info-box">
70 <div class="info-box-title">Constants</div>
72 <a href="#sec-description">Description</a> |
73 <a href="#sec-classes">Classes</a>
74 | <span class="disabled">Constants</span>
75 | <a href="#sec-functions">Functions</a>
77 <div class="info-box-body">
78 <a name="defineGESHI_ACTIVE"><!-- --></a>
82 <img src="../../media/images/Constant.png" />
83 <span class="const-title">
84 <span class="const-name">GESHI_ACTIVE</span> = 2
85 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a107">107</a></span>)
89 <!-- ========== Info from phpDoc block ========= -->
90 <p class="short-description">Links in the source in the :active state</p>
94 <a name="defineGESHI_CAPS_LOWER"><!-- --></a>
98 <img src="../../media/images/Constant.png" />
99 <span class="const-title">
100 <span class="const-name">GESHI_CAPS_LOWER</span> = 2
101 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a99">99</a></span>)
105 <!-- ========== Info from phpDoc block ========= -->
106 <p class="short-description">Leave keywords found as the case that they are</p>
110 <a name="defineGESHI_CAPS_NO_CHANGE"><!-- --></a>
114 <img src="../../media/images/Constant.png" />
115 <span class="const-title">
116 <span class="const-name">GESHI_CAPS_NO_CHANGE</span> = 0
117 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a95">95</a></span>)
121 <!-- ========== Info from phpDoc block ========= -->
122 <p class="short-description">Lowercase keywords found</p>
126 <a name="defineGESHI_CAPS_UPPER"><!-- --></a>
127 <div class="evenrow">
130 <img src="../../media/images/Constant.png" />
131 <span class="const-title">
132 <span class="const-name">GESHI_CAPS_UPPER</span> = 1
133 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a97">97</a></span>)
137 <!-- ========== Info from phpDoc block ========= -->
138 <p class="short-description">Uppercase keywords found</p>
142 <a name="defineGESHI_END_IMPORTANT"><!-- --></a>
146 <img src="../../media/images/Constant.png" />
147 <span class="const-title">
148 <span class="const-name">GESHI_END_IMPORTANT</span> = '<END GeSHi>'
149 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a117">117</a></span>)
153 <!-- ========== Info from phpDoc block ========= -->
154 <p class="short-description">The ender for important parts of the source</p>
158 <a name="defineGESHI_FANCY_LINE_NUMBERS"><!-- --></a>
159 <div class="evenrow">
162 <img src="../../media/images/Constant.png" />
163 <span class="const-title">
164 <span class="const-name">GESHI_FANCY_LINE_NUMBERS</span> = 2
165 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a67">67</a></span>)
169 <!-- ========== Info from phpDoc block ========= -->
170 <p class="short-description">Use fancy line numbers when building the result</p>
174 <a name="defineGESHI_HEADER_DIV"><!-- --></a>
178 <img src="../../media/images/Constant.png" />
179 <span class="const-title">
180 <span class="const-name">GESHI_HEADER_DIV</span> = 1
181 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a73">73</a></span>)
185 <!-- ========== Info from phpDoc block ========= -->
186 <p class="short-description">Use a "div" to surround the source</p>
190 <a name="defineGESHI_HEADER_NONE"><!-- --></a>
191 <div class="evenrow">
194 <img src="../../media/images/Constant.png" />
195 <span class="const-title">
196 <span class="const-name">GESHI_HEADER_NONE</span> = 0
197 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a71">71</a></span>)
201 <!-- ========== Info from phpDoc block ========= -->
202 <p class="short-description">Use nothing to surround the source</p>
206 <a name="defineGESHI_HEADER_PRE"><!-- --></a>
210 <img src="../../media/images/Constant.png" />
211 <span class="const-title">
212 <span class="const-name">GESHI_HEADER_PRE</span> = 2
213 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a75">75</a></span>)
217 <!-- ========== Info from phpDoc block ========= -->
218 <p class="short-description">Use a "pre" to surround the source</p>
222 <a name="defineGESHI_HEADER_PRE_TABLE"><!-- --></a>
223 <div class="evenrow">
226 <img src="../../media/images/Constant.png" />
227 <span class="const-title">
228 <span class="const-name">GESHI_HEADER_PRE_TABLE</span> = 4
229 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a91">91</a></span>)
233 <!-- ========== Info from phpDoc block ========= -->
234 <p class="short-description">Use a "table" to surround the source:</p>
235 <p class="description"><p><table> <thead><tr><td colspan="2">$header</td></tr></thead> <tbody><tr><td><pre>$linenumbers</pre></td><td><pre>$code></pre></td></tr></tbody> <tfooter><tr><td colspan="2">$footer</td></tr></tfoot> </table></p><p>this is essentially only a workaround for Firefox, see sf#1651996 or take a look at https://bugzilla.mozilla.org/show_bug.cgi?id=365805</p></p>
237 <li><span class="field">note:</span> when linenumbers are disabled this is essentially the same as GESHI_HEADER_PRE</li>
242 <a name="defineGESHI_HEADER_PRE_VALID"><!-- --></a>
246 <img src="../../media/images/Constant.png" />
247 <span class="const-title">
248 <span class="const-name">GESHI_HEADER_PRE_VALID</span> = 3
249 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a77">77</a></span>)
253 <!-- ========== Info from phpDoc block ========= -->
254 <p class="short-description">Use a pre to wrap lines when line numbers are enabled or to wrap the whole code.</p>
258 <a name="defineGESHI_HOVER"><!-- --></a>
259 <div class="evenrow">
262 <img src="../../media/images/Constant.png" />
263 <span class="const-title">
264 <span class="const-name">GESHI_HOVER</span> = 1
265 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a105">105</a></span>)
269 <!-- ========== Info from phpDoc block ========= -->
270 <p class="short-description">Links in the source in the :hover state</p>
274 <a name="defineGESHI_LANG_ROOT"><!-- --></a>
278 <img src="../../media/images/Constant.png" />
279 <span class="const-title">
280 <span class="const-name">GESHI_LANG_ROOT</span> = GESHI_ROOT.'geshi'.DIRECTORY_SEPARATOR
281 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a53">53</a></span>)
285 <!-- ========== Info from phpDoc block ========= -->
286 <p class="short-description">The language file directory for GeSHi</p>
290 <a name="defineGESHI_LINK"><!-- --></a>
291 <div class="evenrow">
294 <img src="../../media/images/Constant.png" />
295 <span class="const-title">
296 <span class="const-name">GESHI_LINK</span> = 0
297 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a103">103</a></span>)
301 <!-- ========== Info from phpDoc block ========= -->
302 <p class="short-description">Links in the source in the :link state</p>
306 <a name="defineGESHI_NORMAL_LINE_NUMBERS"><!-- --></a>
310 <img src="../../media/images/Constant.png" />
311 <span class="const-title">
312 <span class="const-name">GESHI_NORMAL_LINE_NUMBERS</span> = 1
313 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a65">65</a></span>)
317 <!-- ========== Info from phpDoc block ========= -->
318 <p class="short-description">Use normal line numbers when building the result</p>
322 <a name="defineGESHI_NO_LINE_NUMBERS"><!-- --></a>
323 <div class="evenrow">
326 <img src="../../media/images/Constant.png" />
327 <span class="const-title">
328 <span class="const-name">GESHI_NO_LINE_NUMBERS</span> = 0
329 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a63">63</a></span>)
333 <!-- ========== Info from phpDoc block ========= -->
334 <p class="short-description">Use no line numbers when building the result</p>
338 <a name="defineGESHI_ROOT"><!-- --></a>
342 <img src="../../media/images/Constant.png" />
343 <span class="const-title">
344 <span class="const-name">GESHI_ROOT</span> = dirname(__FILE__).DIRECTORY_SEPARATOR
345 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a49">49</a></span>)
349 <!-- ========== Info from phpDoc block ========= -->
350 <p class="short-description">The root directory for GeSHi</p>
354 <a name="defineGESHI_SECURITY_PARANOID"><!-- --></a>
355 <div class="evenrow">
358 <img src="../../media/images/Constant.png" />
359 <span class="const-title">
360 <span class="const-name">GESHI_SECURITY_PARANOID</span> = false
361 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a58">58</a></span>)
365 <!-- ========== Info from phpDoc block ========= -->
366 <p class="short-description">Tells GeSHi to be paranoid about security settings</p>
370 <a name="defineGESHI_START_IMPORTANT"><!-- --></a>
374 <img src="../../media/images/Constant.png" />
375 <span class="const-title">
376 <span class="const-name">GESHI_START_IMPORTANT</span> = '<BEGIN GeSHi>'
377 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a115">115</a></span>)
381 <!-- ========== Info from phpDoc block ========= -->
382 <p class="short-description">The starter for important parts of the source</p>
386 <a name="defineGESHI_VERSION"><!-- --></a>
387 <div class="evenrow">
390 <img src="../../media/images/Constant.png" />
391 <span class="const-title">
392 <span class="const-name">GESHI_VERSION</span> = '1.0.8.2',
393 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a44">44</a></span>)
397 <!-- ========== Info from phpDoc block ========= -->
398 <p class="short-description">The version of this GeSHi file</p>
402 <a name="defineGESHI_VISITED"><!-- --></a>
406 <img src="../../media/images/Constant.png" />
407 <span class="const-title">
408 <span class="const-name">GESHI_VISITED</span> = 3
409 (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a109">109</a></span>)
413 <!-- ========== Info from phpDoc block ========= -->
414 <p class="short-description">Links in the source in the :visited state</p>
422 <a name="sec-functions"></a>
423 <div class="info-box">
424 <div class="info-box-title">Functions</div>
425 <div class="nav-bar">
426 <a href="#sec-description">Description</a> |
427 <a href="#sec-classes">Classes</a>
428 | <a href="#sec-constants">Constants</a>
429 | <span class="disabled">Functions</span>
431 <div class="info-box-body">
432 <a name="functiongeshi_highlight" id="functiongeshi_highlight"><!-- --></a>
433 <div class="evenrow">
436 <img src="../../media/images/Function.png" />
437 <span class="method-title">geshi_highlight</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a4577">4577</a></span>)
440 <!-- ========== Info from phpDoc block ========= -->
441 <p class="short-description">Easy way to highlight stuff. Behaves just like highlight_string</p>
443 <li><span class="field">return:</span> The code highlighted (if $return is true)</li>
444 <li><span class="field">since:</span> 1.0.2</li>
446 <div class="method-signature">
447 <span class="method-result">string</span>
448 <span class="method-name">
451 (<span class="var-type">string</span> <span class="var-name">$string</span>, <span class="var-type">string</span> <span class="var-name">$language</span>, [<span class="var-type">string</span> <span class="var-name">$path</span> = <span class="var-default">null</span>], [<span class="var-type">boolean</span> <span class="var-name">$return</span> = <span class="var-default">false</span>])
454 <ul class="parameters">
456 <span class="var-type">string</span>
457 <span class="var-name">$string</span><span class="var-description">: The code to highlight</span> </li>
459 <span class="var-type">string</span>
460 <span class="var-name">$language</span><span class="var-description">: The language to highlight the code in</span> </li>
462 <span class="var-type">string</span>
463 <span class="var-name">$path</span><span class="var-description">: The path to the language files. You can leave this blank if you need as from version 1.0.7 the path should be automatically detected</span> </li>
465 <span class="var-type">boolean</span>
466 <span class="var-name">$return</span><span class="var-description">: Whether to return the result or to echo</span> </li>
474 <p class="notes" id="credit">
475 Documentation generated on Thu, 25 Dec 2008 14:34:34 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>