emailconfirmed, nsInternRO, nsInternRW, Administrators
3,356
edits
m (Created) |
m (Source Plugin) |
||
Line 209: | Line 209: | ||
MediaWiki ignores normal line breaks. To start a new paragraph, leave an empty line. You can also start a new line with the HTML tags <tt><nowiki><br> or <br/></nowiki></tt>. | MediaWiki ignores normal line breaks. To start a new paragraph, leave an empty line. You can also start a new line with the HTML tags <tt><nowiki><br> or <br/></nowiki></tt>. | ||
== HTML == | == HTML & Sourcecode == | ||
Some [[wikipedia:HTML|HTML]] tags are allowed in MediaWiki, for example | Some [[wikipedia:HTML|HTML]] tags are allowed in MediaWiki, for example <tt><nowiki><div></nowiki></tt>, <tt><nowiki><span></nowiki></tt> and <tt><nowiki><font></nowiki></tt>. | ||
If you want to use <tt><nowiki><code></nowiki></tt>, you should use <tt><source></tt> instead! It supports Syntax Coloring. You can also specify a language, eg. <tt><source lang="c"></tt> : | |||
<source lang="c" line start="0" highlight="4" enclose="div"> | |||
// Global variable | |||
int x = 7; | |||
int myFunction(int a) { | |||
// Local variable | |||
int b = 8; | |||
return (a + b); | |||
} | |||
</source> | |||
Please see the [http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi MediaWiki GeSHi Page] for detailed information to use some of the parameters: | |||
* enclose="div": enables indentation with 4 spaces | |||
* lang="xyz": ''defines the language'', eg. "c", "php", ... | |||
* line: ''show line numbering'' | |||
* line start="55": ''first line is labeled #55'' | |||
* hilight="4'': ''hilights line #4'' | |||
== Other formatting == | == Other formatting == |