Help:Adding a new programming example: Difference between revisions
Content added Content deleted
(Undo revision 8482 by Special:Contributions/OmtDe5 (User talk:OmtDe5)) |
(move stuff from "add a new language" page) |
||
Line 1: | Line 1: | ||
⚫ | |||
So you want to contribute code, eh? If you've used wikis before, it's actually very easy. If not, then you'll need a few pointers to get started. |
So you want to contribute code, eh? If you've used wikis before, it's actually very easy. If not, then you'll need a few pointers to get started. |
||
Line 8: | Line 7: | ||
==Navigation== |
==Navigation== |
||
To add your own programming example, you must [[:Category:Solutions by Programming Task|navigate]] to the programming task to which you wish to add a solution to. Once you find your task, go ahead and click the Edit button, and make your changes. |
To add your own programming example, you must [[:Category:Solutions by Programming Task|navigate]] to the programming task to which you wish to add a solution to. Once you find your task, go ahead and click the Edit button, find the place in the list of languages already applied where your language would fall alphabetically, and make your changes. |
||
⚫ | In order to maintain the readability, searchability and browsability 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}}== |
|||
'''Compiler:''' [[GCC]] 4.0.1 |
|||
int main ( void ) { |
|||
// Some code here |
|||
}</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. To create a link, surround the text with double square brackets. For example, [[GCC]] would be represented as <nowiki>[[GCC]]</nowiki>. |
|||
Finally, note the importance of the extra space in front of the code. That creates a dashed box around the code sample, and puts it in a monospace font. |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
Now, why don't you wander over to the [[Help:Sandbox|Sandbox]] and apply what you've learned? |
Now, why don't you wander over to the [[Help:Sandbox|Sandbox]] and apply what you've learned? |
||
⚫ |