How can I format my C# code so it displays correctly in our internal Wiki?
We are using MediaWiki although I assume most wiki syntax is the same.
markdownmediawikiwiki
How can I format my C# code so it displays correctly in our internal Wiki?
We are using MediaWiki although I assume most wiki syntax is the same.
Best Answer
If you are using the GeShi syntax highlighting extension to MediaWiki, then you can just insert your C♯ code as-is, enclosed within a
<syntaxhighlight/>
element. (This is, as you can see from the syntax highlighting extensions category, one of several such MediaWiki extensions.)The MediaWiki wikis used, by the Wikimedia Foundation, for Wikipedia, Wiktionary, Wikibooks, Wikiquote, et al. all have this extension enabled. Here is some wikitext taken directly from the current (at the time of writing) Wikipedia article for C♯ (q.v.) that exemplifies what the wikitext looks like:
See the Wikipedia article for how this wikitext is rendered.