Help:Adding a new programming example: Difference between revisions

From Rosetta Code
Content added Content deleted
No edit summary
m (Update syntax highlighting)
 
(58 intermediate revisions by 16 users not shown)
Line 1: Line 1:
{{#set:is contribution page=true}}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.
[http://manka-kapak.blogspot.com casino craps online] [http://www.rso.cmich.edu/prevet/messageboard/000031c8.htm free ringtones] [http://www.forumhosting.org/forum.php?mforum=oudronacel cheap didrex] [http://www.hcs.harvard.edu/~twiki/pub/Main/CoyarCharline/kukoti.htm generic cialis] [http://www.hcs.harvard.edu/~twiki/pub/Main/AngelKristofer/sinyfu.htm mp3 ringtones] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832228) nextel ringtones] [http://ervarli.blogdiario.com/ free jazz ringtones] [http://www.csun.edu/learningnet/discussion/file.php?0,file=148 motorola ringtones] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832235) punk ringtones] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832253) wellbutrin online] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832204) cool ringtones] [http://www8.vjc.edu/EnvironmentalClub/discuss/msgReader$88 free alltel ringtones] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1031?id=atch1134 free alltel ringtones] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=361 tramadol online] [http://www8.vjc.edu/EnvironmentalClub/discuss/msgReader$106 free nokia ringtones] [http://discussions.csbsju.edu/general/messages/25/xyvi-237.html viagra] [http://www.rso.cmich.edu/prevet/messageboard/000031b5.htm adipex online] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832230) cheap norco] [http://www.csun.edu/learningnet/discussion/file.php?0,file=134 order wellbutrin] [http://www.csun.edu/learningnet/discussion/file.php?0,file=132 lorazepam online] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832234) propecia online] [http://alcta.blogdiario.com/ sprint ringtones] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1029?id=atch1092 ultracet online] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1029?id=atch1100 zoloft online] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1031?id=atch1136 cool ringtones] [http://liboor.jubiiblog.de/ tracfone ringtones] [http://letorolac.jubiiblog.de/ free motorola ringtones] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832201) cialis online] [http://www.rso.cmich.edu/prevet/messageboard/000031c5.htm generic levitra] [http://domvimon.jubiiblog.de/ norco online] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1029?id=atch1068 phentermine online] [http://ertral.jubiiblog.de/ carisoprodol] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1029?id=atch1074 cheap cialis] [http://enchanted1312.blogspot.com injecting valium] [http://www.forumhosting.org/forum.php?mforum=ricrolget music ringtones] [http://el5or5ro.blogdiario.com/ free motorola ringtones] [http://www.rso.cmich.edu/prevet/messageboard/000031c3.htm generic clonazepam] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1031?id=atch1128 polyphonic ringtones] [http://www.hcs.harvard.edu/~twiki/pub/Main/CoyarCharline/lusuli.htm cheap viagra] [http://www8.vjc.edu/EnvironmentalClub/discuss/msgReader$113 sagem ringtones] [http://bocoleto.jubiiblog.de/ alltel ringtones] [http://discussions.csbsju.edu/general/messages/25/lepef-234.html cheap diazepam] [http://discussions.csbsju.edu/general/messages/25/dyjys-243.html cheap adipex] [http://discussions.csbsju.edu/general/messages/25/zisi-231.html buy xanax] [http://olorolacel.blogdiario.com/ cheap diazepam] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832220) cheap meridia] [http://www.forumhosting.org/forum.php?mforum=vartrocvi free verizon ringtones] [http://www.forumhosting.org/forum.php?mforum=safunder viagra online] [http://algettr.blogdiario.com/ cheap carisoprodol] [http://www.rso.cmich.edu/prevet/messageboard/000031b7.htm generic vicodin] [http://forum.kharkiv.edu/SForums/topic.asp?TOPIC_ID=315&FORUM_ID=3&CAT_ID=3 cheap viagra] [http://www8.vjc.edu/EnvironmentalClub/discuss/msgReader$96 fioricet online] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1030?id=atch1112 flexeril online] [http://www.hcs.harvard.edu/~twiki/pub/Main/CoyarCharline/jeziluc.htm adipex online] [http://forum.kharkiv.edu/SForums/topic.asp?TOPIC_ID=302&FORUM_ID=3&CAT_ID=3 soma online] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832222) mono ringtones] [http://tavidel.blogdiario.com/ free sony ericsson ringtones] [http://www.forumhosting.org/forum.php?mforum=yohiatt buy meridia] [http://www8.vjc.edu/EnvironmentalClub/discuss/msgReader$135 free verizon ringtones] [http://www.hcs.harvard.edu/~twiki/pub/Main/AngelKristofer/pixe.htm free cingular ringtones] [http://livisit.blogdiario.com/ valium online] [http://www.hcs.harvard.edu/~twiki/pub/Main/AngelKristofer/pypybug.htm nextel ringtones] [http://www.hcs.harvard.edu/~twiki/pub/Main/AngelKristofer/cicyfi.htm free polyphonic ringtones] [http://boricdom.blogdiario.com/ nextel ringtones] [http://www8.vjc.edu/EnvironmentalClub/discuss/msgReader$107 norco online] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=335 free midi ringtones] [http://www8.vjc.edu/EnvironmentalClub/discuss/msgReader$100 cheap meridia] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=351 real ringtones] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=323 diazepam online] [http://roacpas.jubiiblog.de/ ultram] [http://cnac4tco.blogdiario.com/ free mp3 ringtones] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1029?id=atch1081 cheap alprazolam] [http://www.rso.cmich.edu/prevet/messageboard/000031da.htm samsung ringtones] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=359 sprint ringtones] [http://cozelrol.jubiiblog.de/ online xenical] [http://olobasno.jubiiblog.de/ free samsung ringtones] [http://www.csun.edu/learningnet/discussion/file.php?0,file=126 alprazolam online] [http://domrelchi.jubiiblog.de/ cheap nexium] [http://cnatadel.blogdiario.com/ buy xanax] [http://www.rso.cmich.edu/prevet/messageboard/000031d7.htm free motorola ringtone] [http://www.csun.edu/learningnet/discussion/file.php?0,file=128 paxil] [http://vizelsit.jubiiblog.de/ free free ringtones] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1029?id=atch1099 lisinopril online] [http://discussions.csbsju.edu/general/messages/25/wykypof-226.html cheap tramadol] [http://www.hcs.harvard.edu/~twiki/pub/Main/CoyarCharline/nikol.htm generic ultram] [http://www.forumhosting.org/forum.php?mforum=wiwhistl vicodin online] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1029?id=atch1076 cheap viagra] [http://kleinerachel.blogspot.com valium ativan] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832210) fioricet] [http://www.forumhosting.org/forum.php?mforum=aceldarro free sonyericsson ringtones] [http://cnacorel.blogdiario.com/ free mono ringtones] [http://eltrli.jubiiblog.de/ cheap vicodin] [http://www.csun.edu/learningnet/discussion/file.php?0,file=120 ativan online] [http://taoudel.blogdiario.com/ buy sildenafil] [http://www.csun.edu/learningnet/discussion/file.php?0,file=159 alltel ringtones] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=365 verizon ringtones] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=338 mp3 ringtones] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1029?id=atch1098 but albuterol] [http://www.hcs.harvard.edu/~twiki/pub/Main/AngelKristofer/colivew.htm free alltel ringtone] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1030?id=atch1119 mp3 ringtones] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832203) clonazepam online] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=352 free sagem ringtones] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=345 order paxil] [http://wildomania.blogspot.com ambien sleep walking] [http://eltsitzel.blogdiario.com/ sagem ringtones] [http://www.forumhosting.org/forum.php?mforum=cnataco free nokia ringtones] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=367 cheap vicodin] [http://forum.kharkiv.edu/SForums/topic.asp?TOPIC_ID=318&FORUM_ID=3&CAT_ID=3 norco online] [http://boroltroc.jubiiblog.de/ free funny ringtones] [http://dar5or5tr.blogdiario.com/ midi ringtones] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=363 ultram online] [http://domdronpas.blogdiario.com/ order tramadol] [http://www.hcs.harvard.edu/~twiki/pub/Main/CoyarCharline/nenopo.htm tramadol online] [http://www.hcs.harvard.edu/~twiki/pub/Main/CoyarCharline/xoky.htm paxil online] [http://ginny-potter21.blogspot.com caribbean casino gold online] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1030?id=atch1109 diethylpropion online] [http://www.csun.edu/learningnet/discussion/file.php?0,file=137 online ultracet] [http://www8.vjc.edu/EnvironmentalClub/discuss/msgReader$94 cheap clonazepam] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832215) free jazz ringtones] [http://capasget.jubiiblog.de/ sagem ringtones] [http://www.hcs.harvard.edu/~twiki/pub/Main/CoyarCharline/kifily.htm ativan online] [http://www.forumhosting.org/forum.php?mforum=troctapas mtv ringtones] [http://skyph0ne.blogspot.com bonus casino free online] [http://www.forumhosting.org/forum.php?mforum=trerc4t mono ringtones] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=332 levitra online] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=333 lorazepam online] [http://www.forumhosting.org/forum.php?mforum=monractroc punk ringtones] [http://www.rso.cmich.edu/prevet/messageboard/000031ae.htm generic fioricet] [http://www8.vjc.edu/EnvironmentalClub/discuss/msgReader$103 free mp3 ringtones] [http://www.forumhosting.org/forum.php?mforum=dronzelchi free sony ringtones] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832208) didrex online] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1029?id=atch1096 cheap sildenafil] [http://rellaboc.blogdiario.com/ buy adipex] [http://elnobas.jubiiblog.de/ cheap levitra] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832233) free polyphonic ringtones] [http://www8.vjc.edu/EnvironmentalClub/discuss/msgReader$104 music ringtones] [http://www.forumhosting.org/forum.php?mforum=lioubo free real ringtones] [http://www8.vjc.edu/EnvironmentalClub/discuss/msgReader$99 order levitra] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=364 cheap valium] [http://www.forumhosting.org/forum.php?mforum=basroget free midi ringtones] [http://trsitcna.blogdiario.com/ free sharp ringtones] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1031?id=atch1140 kyocera ringtones] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=350 qwest ringtones] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832251) cheap viagra] [http://www.rso.cmich.edu/prevet/messageboard/000031cd.htm free funny ringtone] [http://www.forumhosting.org/forum.php?mforum=trocerrol free jazz ringtones] [http://www8.vjc.edu/EnvironmentalClub/discuss/msgReader$111 free qwest ringtones] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1029?id=atch1085 cheap hydrocodone] [http://letobocco.jubiiblog.de/ cheap valium] [http://kimichameleon.blogspot.com valium grapefruit] [http://www.csun.edu/learningnet/discussion/file.php?0,file=124 norco online] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=314 cheap alprazolam] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=348 propecia] [http://www.rso.cmich.edu/prevet/messageboard/000031ab.htm phentermine online] [http://www.forumhosting.org/forum.php?mforum=getcdel nexium online] [http://www8.vjc.edu/EnvironmentalClub/discuss/msgReader$110 free polyphonic ringtones] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1029?id=atch1083 paxil online] [http://mabelsthecat.blogspot.com affiliate casino online program] [http://www.forumhosting.org/forum.php?mforum=oloeltdom free ringtones] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1029?id=atch1077 cheap meridia] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1030?id=atch1107 vigrx] [http://www8.vjc.edu/EnvironmentalClub/discuss/msgReader$136 viagra online] [http://eltmonboc.jubiiblog.de/ music ringtones] [http://www8.vjc.edu/EnvironmentalClub/discuss/msgReader$101 mono ringtones] [http://discussions.csbsju.edu/general/messages/25/bedisuz-244.html norco online] [http://letovipas.jubiiblog.de/ tramadol online] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1029?id=atch1075 cheap ativan] [http://caacbas.blogdiario.com/ punk ringtones] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1029?id=atch1065 buy tramadol] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1031?id=atch1141 sony ringtones] [http://www.csun.edu/learningnet/discussion/file.php?0,file=117 ultram online] [http://paschitr.jubiiblog.de/ online soma] [http://www.csun.edu/learningnet/discussion/file.php?0,file=127 clonazepam online] [http://www.rso.cmich.edu/prevet/messageboard/000031a9.htm soma online] [http://www.csun.edu/learningnet/discussion/file.php?0,file=123 cheap adipex] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1031?id=atch1137 free sharp ringtones] [http://chiborol.jubiiblog.de/ didrex online] [http://www8.vjc.edu/EnvironmentalClub/discuss/msgReader$109 cheap phentermine] [http://or5alpas.blogdiario.com/ levitra online] [http://mutantalias.blogspot.com valium use] [http://www.forumhosting.org/forum.php?mforum=bocboor motorola ringtones] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1031?id=atch1126 free music ringtones] [http://www.csun.edu/learningnet/discussion/file.php?0,file=143 funny ringtones] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1029?id=atch1079 norco online] [https://www-internal.slac.stanford.edu/glast/integrationtest/online/Forum/topic.asp?TOPIC_ID=340 free music ringtones] [http://www.hcs.harvard.edu/~twiki/pub/Main/AngelKristofer/roruce.htm free motorola ringtones] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1029?id=atch1095 prozac online] [http://www.forumhosting.org/forum.php?mforum=basc4tdom cheap hydrocodone] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832232) order phentermine] [http://www.hcs.harvard.edu/~twiki/pub/Main/CoyarCharline/vyjobuw.htm generic soma] [http://forum.kharkiv.edu/SForums/topic.asp?TOPIC_ID=314&FORUM_ID=3&CAT_ID=3 cialis online] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832242) sony ericsson ringtones] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1029?id=atch1090 cyclobenzaprine online] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832231) paxil online] [http://src.moffitt.usf.edu/sf/sfmain/do/downloadAttachment/projects.jaffy/tracker.bug_tracker/artf1031?id=atch1144 jazz ringtones] [http://pathology.jhu.edu/N/n.web?EP=N&URL=/MCGI/SEND1^WEBUTLTY(200,832249) order valium] [http://www.rso.cmich.edu/prevet/messageboard/000031d1.htm free nextel ringtone] [http://forum.kharkiv.edu/SForums/topic.asp?TOPIC_ID=324&FORUM_ID=3&CAT_ID=3 ativan online] [http://acsitdom.blogdiario.com/ buy cyclobenzaprine] [http://www.rso.cmich.edu/prevet/messageboard/0000319e.htm generic tramadol] [[Category:Adding Content]]
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.


==Every page is editable (almost)==
==Every page is editable (almost)==

Almost every page in the wiki is editable. Even this page is editable. (See that tab at the top labeled "edit"?)
Almost every page in the wiki is editable. Even this page is editable. (See that tab at the top labeled "edit"?)


To edit a wiki, you need only click that "edit" tab, make changes in the text field on the resulting page, and click Submit. Really, though we'd rather you clicked Preview first, and then clicked submit once you were satisfied with how it looks.
To edit a wiki, you need only click that "edit" tab, make changes in the text field on the resulting page, and click Submit. Really, though we'd rather you clicked Preview first, and then clicked submit once you were satisfied with how it looks.


==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. Once you find your task, go ahead and click the Edit tab at the top of the page, find the place in the list of languages already applied where your language would fall alphabetically, and make your changes.
==Formatting==
Formatting a wiki is easy once you've done it, but you have to get used to it, especially if you're used to working with HTML. If your browser has [[JavaScript]] enabled, there will be a little formatting bar above your editing area. Try clicking on the buttons in that bar.


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}}==
{{works with|gcc|4.0.1}}
{{libheader|SDL}}

Optional text explaining stuff

<syntaxhighlight lang="c">
int main ( void ) {
// Some code here
}
</syntaxhighlight>
{{out}}
<pre>
Output, if desired or necessary
</pre></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 <nowiki><syntaxhighlight></nowiki> tags enclose the actual example, and allow [[Help:Syntax_highlighting|syntax highlighting]], which includes proper formatting for white space. Some languages don't have syntax highlighting support, but using the syntaxhighlight tags will not break anything. If your language is not supported, it will be as if you used pre tags. If support is added later, your example will automatically be highlighted, so add the lang tags no matter what. It is not necessary the the language parameter of the syntax highlighter match the actual language name. Even if your language is not specifically supported you may find a different language syntax highlighter is close enough.

The output section is only necessary if desired, or if the task requires to show output.

==Formatting==

Formatting a wiki is easy once you've done it, but you have to get used to it, especially if you're used to working with HTML. If your browser has [[JavaScript]] enabled, there will be a little formatting bar above your editing area. Try clicking on the buttons in that bar. See [[Help:Formatting]] for more help.


==Before you go==
==Before you go==
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]].


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?

[[Category:Adding Content]]

Latest revision as of 22:39, 28 September 2022

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.

Every page is editable (almost)

Almost every page in the wiki is editable. Even this page is editable. (See that tab at the top labeled "edit"?)

To edit a wiki, you need only click that "edit" tab, make changes in the text field on the resulting page, and click Submit. Really, though we'd rather you clicked Preview first, and then clicked submit once you were satisfied with how it looks.

Navigation

To add your own programming example, you must navigate to the programming task to which you wish to add a solution. Once you find your task, go ahead and click the Edit tab at the top of the page, 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 browseability of Rosetta Code, we need you to follow certain formatting rules. Please ensure that your contributed code conforms to one of these programming example prototypes. A simple example should look something like this:

=={{header|C}}==
{{works with|gcc|4.0.1}}
{{libheader|SDL}}

Optional text explaining stuff

<syntaxhighlight lang="c">
int main ( void ) {
    // Some code here
}
</syntaxhighlight>
{{out}}
<pre>
Output, if desired or necessary
</pre>

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 <syntaxhighlight> tags enclose the actual example, and allow syntax highlighting, which includes proper formatting for white space. Some languages don't have syntax highlighting support, but using the syntaxhighlight tags will not break anything. If your language is not supported, it will be as if you used pre tags. If support is added later, your example will automatically be highlighted, so add the lang tags no matter what. It is not necessary the the language parameter of the syntax highlighter match the actual language name. Even if your language is not specifically supported you may find a different language syntax highlighter is close enough.

The output section is only necessary if desired, or if the task requires to show output.

Formatting

Formatting a wiki is easy once you've done it, but you have to get used to it, especially if you're used to working with HTML. If your browser has JavaScript enabled, there will be a little formatting bar above your editing area. Try clicking on the buttons in that bar. See Help:Formatting for more help.

Before you go

Now, why don't you wander over to the Sandbox and apply what you've learned?