1 |
jpye |
1392 |
|
2 |
|
|
MediaWiki support for Andre Simon's 'highlight' program |
3 |
|
|
======================================================= |
4 |
|
|
|
5 |
|
|
This directory contains files to provide support in MediaWiki for Andre Simon's |
6 |
|
|
'highlight' program, a source code syntax highlighting program written in C++ |
7 |
|
|
that provides support for over 120 different programming languages. |
8 |
|
|
|
9 |
|
|
http://www.andre-simon.de/ |
10 |
|
|
|
11 |
|
|
|
12 |
|
|
Installation |
13 |
|
|
------------ |
14 |
|
|
|
15 |
|
|
To install this extension, download the files and place them in your MediaWiki |
16 |
|
|
'extensions' folder (on my system, it's /var/www/wiki/extensions'). You might |
17 |
|
|
want to keep them self-contained, eg /var/www/wiki/extensions/ASHighlight. |
18 |
|
|
|
19 |
|
|
Then, edit your LocalSettings.php file to include the ashighlight.php file, eg |
20 |
|
|
|
21 |
|
|
require_once( "{$IP}/extensions/ASHighlight/ashighlight.php" ); |
22 |
|
|
|
23 |
jpye |
1481 |
If you highlight .lang files are in a non-standard location, edit the file |
24 |
|
|
ashighlight.class.php and modify the value of ASHIGHLIGHT_LANG_ROOT. This |
25 |
|
|
file location is used by ashighlight.php to generate the list of allowed |
26 |
|
|
file extensions for the 'lang=' attribute of the <source> tag. |
27 |
jpye |
1392 |
|
28 |
|
|
Usage |
29 |
|
|
----- |
30 |
|
|
|
31 |
|
|
Insert source code into your wiki pages using the following syntax: |
32 |
|
|
|
33 |
|
|
<source lang="LANGNAME"> |
34 |
|
|
... |
35 |
|
|
</source> |
36 |
|
|
|
37 |
|
|
where LANGNAME is the normal file extension used by source code in the language |
38 |
|
|
you are using. If you choose an invalid LANGNAME value, your wiki page will |
39 |
|
|
show a list of the languages supported on your machine. |
40 |
|
|
|
41 |
|
|
There is also experimental support for the following additional parameters. |
42 |
|
|
Please try them out and report any problems. |
43 |
|
|
* tabwidth=N (replace all tabs with N spaces) |
44 |
|
|
* line=1 (add line numbers) |
45 |
|
|
* start=N (start line numbers at N) |
46 |
|
|
|
47 |
|
|
|
48 |
|
|
Known limitations |
49 |
|
|
----------------- |
50 |
|
|
|
51 |
|
|
If you try out this extension and have any problems with it, please let me know: |
52 |
|
|
Mail to john at curioussymbols. dot c o m. |
53 |
|
|
|
54 |
|
|
Currently, there are likely to be problems with using multiple different |
55 |
|
|
languages on a single web page, due to the way that CSS tags are currently |
56 |
|
|
being added to the page. If you know how to fix this on MediaWiki 1.9, please |
57 |
|
|
let me know. |
58 |
|
|
|
59 |
|
|
|
60 |
|
|
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
|