| 1 |
|
| 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 |
|
| 24 |
Usage |
| 25 |
----- |
| 26 |
|
| 27 |
Insert source code into your wiki pages using the following syntax: |
| 28 |
|
| 29 |
<source lang="LANGNAME"> |
| 30 |
... |
| 31 |
</source> |
| 32 |
|
| 33 |
where LANGNAME is the normal file extension used by source code in the language |
| 34 |
you are using. If you choose an invalid LANGNAME value, your wiki page will |
| 35 |
show a list of the languages supported on your machine. |
| 36 |
|
| 37 |
There is also experimental support for the following additional parameters. |
| 38 |
Please try them out and report any problems. |
| 39 |
* tabwidth=N (replace all tabs with N spaces) |
| 40 |
* line=1 (add line numbers) |
| 41 |
* start=N (start line numbers at N) |
| 42 |
|
| 43 |
|
| 44 |
Known limitations |
| 45 |
----------------- |
| 46 |
|
| 47 |
If you try out this extension and have any problems with it, please let me know: |
| 48 |
Mail to john at curioussymbols. dot c o m. |
| 49 |
|
| 50 |
Currently, there are likely to be problems with using multiple different |
| 51 |
languages on a single web page, due to the way that CSS tags are currently |
| 52 |
being added to the page. If you know how to fix this on MediaWiki 1.9, please |
| 53 |
let me know. |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|