Last modified: 2008-11-07 08:16:10 UTC
Sometimes when I am sharing how to code something, it would help if I had a tag that would highlight syntax of that code. <syntax-wiki> might work like the <nowiki> tag. However, it would cause HTML entity codes to be ignored and most wiki syntax would get color codes. I am NOT talking about while editing. wikEd does a fine job there. Rather, I want the result to get the highlighted text. Other possible tags: <syntax-php>, <syntax-html>, <syntax-xhtml>, <syntax-js>, <syntax-css>, (from here as extensions?) <syntax-blogger>, <syntax-cplus>, <syntax-csharp>, etc.
We have numerous syntax highlighting extensions. On Wikimedia, look at the <code> tag.
http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi is the extension that Wikimedia uses. It allows for a variety of syntax highlighting languages, like <source lang="php"> and <source lang="javascript">. It also has an optional line count feature.
I am not aware that <code> lets you control which language is used. <source>? Maybe. But I wasn't aware that Wikipedia had it. Does someone know if Wikia does?