Jump to content

Help:Adding a new programming example: Difference between revisions

m
→‎Navigation: Fixed up a bit, when will we get code highlighting working?
(Updated example for new code-tags)
m (→‎Navigation: Fixed up a bit, when will we get code highlighting working?)
Line 13:
In order to maintain the readability, searchability and browseability of Rosetta Code, we need you to follow certain formatting rules. Please ensure that your contributed code conforms to one of these [[Help:Programming Example Prototypes|programming example prototypes]]. A simple example should look something like this:
 
<nowiki>=={{header|C}}==
=={{header|C}}==
{{works with|gcc|4.0.1}}
{{libheader|SDL}}
 
Optional text explaining stuff
 
<code lang="C">
int main ( void ) {
// Some code here
}
</code></nowiki>
</nowiki>
 
You don't have to use the C programming language, and your code example will probably be different. You need to make sure you create a link to your language of choice, and to your compiler, interpreter, or what-have-you using the "works with" template. You should also note any special [[libraries]] you use with the "libheader" template.
 
The &lt;<nowiki><code&gt;></nowiki> tags enclose the actual example, and allow [[Help::Syntax_highlighting |syntax highlighting]], which includes proper formatting for white space.
 
==Formatting==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.