~pastebin-ng-team/pastebin-ng/trunk

« back to all changes in this revision

Viewing changes to lib/geshi/docs/geshi-doc.html

  • Committer: Patrick Carlson
  • Date: 2007-04-05 18:42:21 UTC
  • Revision ID: firefly2442@gmail.com-20070405184221-xtqyvl0kxx9ce6zj
Updated Geshi to latest 1.0.7.19 (stable)

Show diffs side-by-side

added added

removed removed

Lines of Context:
143
143
</head>
144
144
<body>
145
145
<h1 id="top">GeSHi Documentation</h1>
146
 
<h5 style="text-align: center;">Version 1.0.7.17</h5>
 
146
<h5 style="text-align: center;">Version 1.0.7.19</h5>
147
147
<pre>Author:          Nigel McNie
148
 
Copyright:       &copy; Nigel McNie, 2004
 
148
Copyright:       &copy; 2004 - 2007 Nigel McNie
149
149
Email:           <a href="mailto:nigel@geshi.org">nigel@geshi.org</a>
150
150
GeSHi Website:   <a href="http://qbnz.com/highlighter">http://qbnz.com/highlighter</a></pre>
151
151
 
240
240
                <ul>
241
241
                        <li><a href="#setting-a-url">3.13.1 Setting a URL for a Keyword Group</a></li>
242
242
                        <li><a href="#disabling-urls">3.13.2 Disabling URLs for a Keyword Group</a></li>
243
 
                        <li><a href="#styling-links">3.13.3 Styling Links</a></li>
244
 
                        <li><a href="#using-targets">3.13.4 Setting the Link Target</a></li>
 
243
            <li><a href="#disabling-all-urls">3.13.3 Disabling all URLs for Keywords</a></li>
 
244
                        <li><a href="#styling-links">3.13.4 Styling Links</a></li>
 
245
                        <li><a href="#using-targets">3.13.5 Setting the Link Target</a></li>
245
246
                </ul>
246
247
                <li><a href="#using-contextual-importance">3.14 Using Contextual Importance</a></li>
247
248
                <li><a href="#highlighting-special-lines-extra">3.15 Highlighting Special Lines &quot;Extra&quot;</a></li>
1185
1186
<h5 id="changing-the-charset">3.6.4: Changing the Character Set</h5>
1186
1187
<div class="nav"><a href="#top">Top</a> | <a href="#contents">Contents</a> | <a href="#error-handling">Next</a> | <a href="#changing-using-load-from-file">Previous</a></div>
1187
1188
 
 
1189
<div class="note"><div class="note-header">Note:</div><p>As of GeSHi 1.0.7.18, you don't need to use this, as htmlspecialchars is not being used due to a security flaw in it (that is unpatched in even the most recent PHP4 versions, and in PHP5 &lt; 5.2). As long as you set the encoding properly with a php <a href="http://php.net/header">header()</a> call, your foreign characters will be displayed correctly.</p></div>
 
1190
 
1188
1191
<p>As of version 1.0.3, you can use the method <strong><tt>set_encoding</tt></strong> to specify the character set that your
1189
1192
source is in. Valid names are those names that are valid for the PHP function <tt><a href="http://www.php.net/htmlentities">htmlentities()</a></tt>:</p>
1190
1193
 
1206
1209
you're after, or perhaps does have your extension but under a different language. The lookup array is of the form:</p>
1207
1210
 
1208
1211
<pre>array(
1209
 
         *   'lang_name' => array('extension', 'extension', ...),
 
1212
         *   'lang_name' =&gt; array('extension', 'extension', ...),
1210
1213
         *   'lang_name' ...
1211
1214
         * );</pre>
1212
1215
 
1400
1403
this GeSHi object. The keywords you can use are:</p>
1401
1404
 
1402
1405
<ul>
1403
 
        <li><strong>&lt;TIME&gt;:</strong> Is replaced by the time it took for the <tt>parse_code</tt> method - i.e., how
 
1406
    <li><strong>&lt;TIME&gt;</strong> or <strong>{TIME}</strong>: Is replaced by the time it took for the <tt>parse_code</tt> method - i.e., how
1404
1407
        long it took for your code to be highlighted. The time is returned to three decimal places.</li>
1405
 
        <li><strong>&lt;LANGUAGE&gt;:</strong> Is replaced by a nice, friendly version of the language name used to
 
1408
    <li><strong>&lt;LANGUAGE&gt;</strong> or <strong>{LANGUAGE}</strong>: Is replaced by a nice, friendly version of the language name used to
1406
1409
        highlight this code.</li>
1407
 
        <li><strong>&lt;VERSION&gt;:</strong> The GeSHi version used to highlight the code.</li>
 
1410
    <li><strong>&lt;VERSION&gt;</strong> or <strong>{VERSION}</strong>: The GeSHi version used to highlight the code.</li>
1408
1411
</ul>
1409
1412
 
1410
1413
<h5 id="setting-header-content">3.12.2: Setting Header Content</h5>
1476
1479
the GeSHi website in the future.</p>
1477
1480
 
1478
1481
<h5 id="disabling-urls">3.13.2: Disabling a URL for a Keyword Group</h5>
1479
 
<div class="nav"><a href="#top">Top</a> | <a href="#contents">Contents</a> | <a href="#styling-links">Next</a> | <a href="#setting-a-url">Previous</a></div>
 
1482
<div class="nav"><a href="#top">Top</a> | <a href="#contents">Contents</a> | <a href="#disabling-all-urls">Next</a> | <a href="#setting-a-url">Previous</a></div>
1480
1483
 
1481
1484
<p>It's easy to disable a URL for a keyword group: Simply use the method <strong><tt>set_url_for_keyword_group</tt></strong> to pass an empty string
1482
1485
as the URL:</p>
1483
1486
 
1484
1487
<code><span style="color: #0000ff;">$geshi</span>-&gt;<span style="color: #006600;">set_url_for_keyword_group</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$group</span>, <span style="color: #ff0000;">''</span><span style="color: #66cc66;">&#41;</span>;</code>
1485
1488
 
1486
 
<h5 id="styling-links">3.13.3: Styling Links</h5>
1487
 
<div class="nav"><a href="#top">Top</a> | <a href="#contents">Contents</a> | <a href="#using-targets">Next</a> | <a href="#disabling-urls">Previous</a></div>
 
1489
<h5 id="disabling-all-urls">3.13.3 Disabling all URLs for Keywords</h6>
 
1490
<div class="nav"><a href="#top">Top</a> | <a href="#contents">Contents</a> | <a href="#styling-links">Next</a> | <a href="#disabling-urls">Previous</a></div>
 
1491
 
 
1492
<p>As of GeSHi 1.0.7.18, you can disable all URL linking for keywords:</p>
 
1493
 
 
1494
<code><span style="color: #0000ff;">$geshi</span>-&gt;<span style="color: #006600;">enable_keyword_links</span><span style="color: #66cc66;">&#40;</span><span style="color: #000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>;</code>
 
1495
 
 
1496
<h5 id="styling-links">3.13.4: Styling Links</h5>
 
1497
<div class="nav"><a href="#top">Top</a> | <a href="#contents">Contents</a> | <a href="#using-targets">Next</a> | <a href="#disabling-all-urls">Previous</a></div>
1488
1498
 
1489
1499
<p>You can also style the function links. You can style their default status, hovered, active and visited status.
1490
1500
All of this is controlled by one method, <strong><tt>set_link_styles</tt></strong>:</p>
1503
1513
 
1504
1514
<p>And <var>$styles</var> is the stylesheet declarations to apply to the links.</p>
1505
1515
 
1506
 
<h5 id="using-targets">3.13.4: Setting the Link Target</h5>
 
1516
<h5 id="using-targets">3.13.5: Setting the Link Target</h5>
1507
1517
<div class="nav"><a href="#top">Top</a> | <a href="#contents">Contents</a> | <a href="#using-contextual-importance">Next</a> | <a href="#styling-links">Previous</a></div>
1508
1518
 
1509
1519
<p>Perhaps you want to set the target of link attributes, so the manual pages open in a new window? Use the <strong><tt>set_link_target</tt></strong> method:</p>
2036
2046
 * Author: &lt;name&gt; (&lt;e-mail address&gt;)
2037
2047
 * Copyright: (c) 2004 &lt;name&gt; (&lt;website URL&gt;)
2038
2048
 * Release Version: 1.0.0
2039
 
 * CVS Revision Version: $Revision: 865 $
 
2049
 * CVS Revision Version: $Revision: 958 $
2040
2050
 * Date Started: &lt;date started&gt;
2041
 
 * Last Modified: $Date: 2006-11-26 21:16:40 +1300 (Sun, 26 Nov 2006) $
 
2051
 * Last Modified: $Date: 2007-04-01 23:51:03 +1200 (Sun, 01 Apr 2007) $
2042
2052
 *
2043
2053
 * &lt;name-of-language&gt; language file for GeSHi.
2044
2054
 *
2102
2112
        it with the date of the GeSHi release that it is first added to.</li>
2103
2113
</ul>
2104
2114
 
2105
 
<p>Everything should remain the same, including <tt>$Revision: 865 $</tt> and <tt>$Date: 2006-11-26 21:16:40 +1300 (Sun, 26 Nov 2006) $</tt> (I know these may
2106
 
look funny but they have their purpose for those of you who don't know about CVS).</p>
 
2115
<p>Everything should remain the same, including <tt>$Revision: 958 $</tt> and <tt>$Date: 2007-04-01 23:51:03 +1200 (Sun, 01 Apr 2007) $</tt> (I know these may
 
2116
look funny but they have their purpose for those of you who don't know about SVN).</p>
2107
2117
 
2108
2118
<p><strong>Also:</strong> I'm not sure about the copyright on a new language file. I'm not a lawyer, could
2109
2119
someone contact me about whether the copyright for a new language file should be exclusivly the authors,