Hallo!
Ich grabe diesen alten Thread nochmal aus, weil ich den neueren (da gabs doch noch ne Frage wegen dem Syntaxhighlighting - neulich erst) einfach nicht finde.
Und zwar habe ich eine PHP-Klasse gefunden (GeSHi - Generic Syntax Highlighting) mit der relativ einfach jede Sprache gehighlightet werden kann. Dazu müssen halt die Keywords und ein paar Sachen definiert werden. Ich mach das, sobald ich dazu komme, das wird wahrcheinlich aber erst im Sommer nächsten Jahres sein, deshalb poste ich hier mal ein paar Links:
GeSHi - offizielle Site
Bereits unterstützte Sprachen
Die Dokumentation
Eine Beispiel Definitionsdatei
Bitte beachtet die Konvention für die Definitionsdatei:
GeSHi hat geschrieben:There are several conventions that are used in language files. For ease of use and readability, your language files should obey the following rules:
* Indentation is in tabs, not spaces: Use tabs! There's no excuse for using spaces in this day and age, where almost every good editor allows you to change the tab width. Tabs also take up less space, and ensure proper alignment. When you indent, use tabs, and if your editor converts tabs to spaces, tell it not to.
* Strings are in single quotes: Every string in a language file should be in single quotes ('), unless you are specifying a single quote as a quotemark or escape character, in which case they can be in double quotes for readability; or if you are specifying a REGEXP (see below)
* Large arrays are multi-lined: An array with more than three or four values should be broken into multiple lines. In any case, lines should not be wider than a full-screen window (about 100 chars per line max).
* Ending brackets for multi-lined arrays on a new line: Also with a comma after them, unless the array is the last one in a parent array. See the PHP language file for examples of where to use commas.
* Use GeSHi's constants: For capatalisation, regular expressions etc. use the GeSHi constants, not their actual values.
Wenn ihr euch daran haltet, wird die Datei vielleicht ins Paket aufgenommen.
Übrigens:
GeSHi ist unter der "GNU General Public License" veröffentlicht.
Das wars,
Simon