Help:Adding a new programming example: Difference between revisions

From Rosetta Code
Content added Content deleted
mNo edit summary
m (Update syntax highlighting)
 
(41 intermediate revisions by 12 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://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=170 cingular ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=90 cheap hgh] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/propecia_2137.htm propecia online] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/ambien_7869.htm ambien online] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3750 cheap didrex] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=189 but lipitor] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=139 viagra online] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3699 meridia online] [http://students.hsc.unt.edu/housing/item.cfm?type=2851 buy carisoprodol] [http://students.hsc.unt.edu/housing/item.cfm?type=2918 cool ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30316 cheap vigrx] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/verizonringtones_8798.htm verizon ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30330 nokia ringtones] [http://wc1.worldcrossing.com/WebX/.1de609de but alprazolam] [http://wc1.worldcrossing.com/WebX/.1de609e5 free cool ringtones] [http://library.cshl.edu/wp/vb/member.php?u=1359 cheap ambien] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=82 buy diazepam] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=206 cheap pharmacy online] [http://users.wpi.edu/~dance/blahdocs/uploads/nokiaringtones_4263.htm free nokia ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3741 viagra online] [http://library.cshl.edu/wp/vb/member.php?u=1382 free cingular ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2905 free motorola ringtones] [http://library.cshl.edu/wp/vb/member.php?u=1358 hydrocodone online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30309 celexa online] [http://users.wpi.edu/~dance/blahdocs/uploads/nexium_6814.htm nexium online] [http://library.cshl.edu/wp/vb/member.php?u=1363 cyclobenzaprine online] [http://wc1.worldcrossing.com/WebX/.1de60a1b free music ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2914 sony ericsson ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3729 mono ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3734 sony ringtones] [http://wc1.worldcrossing.com/WebX/.1de609f9 norco online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=97 lipitor online] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3747 online xenical] [http://users.wpi.edu/~dance/blahdocs/uploads/ultram_1401.htm ultram online] [http://students.hsc.unt.edu/housing/item.cfm?type=2849 cheap valium] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=85 free ericsson ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2877 prozac online] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3743 cheap vicodin] [http://library.cshl.edu/wp/vb/member.php?u=1388 fioricet online] [http://students.hsc.unt.edu/housing/item.cfm?type=2854 but ultram] [http://wc1.worldcrossing.com/WebX/.1de60a21 paxil online] [http://library.cshl.edu/wp/vb/member.php?u=1368 free nokia ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3754 celexa] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3717 order hgh] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=197 mp3 ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2882 cheap zoloft] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3752 buy albuterol] [http://students.hsc.unt.edu/housing/item.cfm?type=2862 buy vicodin] [http://library.cshl.edu/wp/vb/member.php?u=1378 free sprint ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30244 cheap diazepam] [http://wc1.worldcrossing.com/WebX/.1de609f3 free midi ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a16 levitra online] [http://users.wpi.edu/~dance/blahdocs/uploads/ativan_8101.htm ativan online] [http://wc1.worldcrossing.com/WebX/.1de609fd punk ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=95 free kyocera ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=215 zoloft online] [http://students.hsc.unt.edu/housing/item.cfm?type=2904 free real ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=207 xanax online] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/fioricet_7129.htm cheap fioricet] [http://students.hsc.unt.edu/housing/item.cfm?type=2920 free midi ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=182 free funny ringtones] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/vicodin_8272.htm vicodin online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30356 free cool ringtones] [http://library.cshl.edu/wp/vb/member.php?u=1369 free free ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2867 hydrocodone online] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3770 alltel ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3703 cheap hydrocodone] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3724 sprint ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=79 cheap clonazepam] [http://students.hsc.unt.edu/housing/item.cfm?type=2896 buy zyban] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=132 tenuate online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=147 cheap zoloft] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30280 propecia online] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=194 free midi ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3759 flexeril online] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=213 cheap prozac] [http://wc1.worldcrossing.com/WebX/.1de609df ambien online] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/viagra_2557.htm viagra online] [http://students.hsc.unt.edu/housing/item.cfm?type=2902 nextel ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=117 cheap propecia] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=172 cheap clonazepam] [http://students.hsc.unt.edu/housing/item.cfm?type=2856 cheap cialis] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3720 tracfone ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=143 wwe ringtones] [http://users.wpi.edu/~dance/blahdocs/uploads/wellbutrin_1044.htm wellbutrin online] [http://students.hsc.unt.edu/housing/item.cfm?type=2926 jazz ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2876 didrex online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=116 free polyphonic ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a2e xanax online] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/nokiaringtones_9955.htm free nokia ringtones] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/polyphonicringtones_8614.htm polyphonic ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=88 free ringtones] [http://users.wpi.edu/~dance/blahdocs/uploads/valium_3.htm valium online] [http://wc1.worldcrossing.com/WebX/.1de60a31 zanaflex online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30245 cialis] [http://users.wpi.edu/~dance/blahdocs/uploads/cialis_7892.htm cialis online] [http://students.hsc.unt.edu/housing/item.cfm?type=2885 order tenuate] [http://students.hsc.unt.edu/housing/item.cfm?type=2906 samsung ringtones] [http://users.wpi.edu/~dance/blahdocs/uploads/xanax_3394.htm xanax online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=122 buy rivotril] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3731 sharp ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30312 ortho online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30230 but adipex] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3712 lipitor online] [http://wc1.worldcrossing.com/WebX/.1de60a30 xenical online] [http://wc1.worldcrossing.com/WebX/.1de60a1a free mtv ringtones] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/wellbutrin_1082.htm cheap wellbutrin] [http://wc1.worldcrossing.com/WebX/.1de60a23 polyphonic ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=115 phentermine online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=106 mtv ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a06 tenuate online] [http://users.wpi.edu/~dance/blahdocs/uploads/motorolaringtones_4301.htm free motorola ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3775 jazz ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3721 free mp3 ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30338 free motorola ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=218 free qwest ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=145 cheap xenical] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=239 cheap sildenafil] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3765 samsung ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=80 free cool ringtones] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/levitra_8223.htm levitra] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/nexium_2418.htm buy nexium] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/didrex_2512.htm didrex online] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=180 flexeril online] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3718 cheap hoodia] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=78 online clomid] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/motorolaringtones_6710.htm motorola ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2880 albuterol online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=72 cheap ambien] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/meridia_7674.htm cheap meridia] [http://users.wpi.edu/~dance/blahdocs/uploads/viagra_3820.htm cheap viagra] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3730 free punk ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=237 free samsung ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=2694 valium] [http://wc1.worldcrossing.com/WebX/.1de60a0a vicodin] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30235 cheap soma] [http://wc1.worldcrossing.com/WebX/.1de60a04 sonyericsson ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=114 pharmacy online online] [http://users.wpi.edu/~dance/blahdocs/uploads/propecia_4184.htm cheap propecia] [http://wc1.worldcrossing.com/WebX/.1de60a00 rivotril online] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=187 free kyocera ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a0f cialis online] [http://students.hsc.unt.edu/housing/item.cfm?type=2848 soma online] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/sonyericssonringtones_2032.htm free sonyericsson ringtones] [http://users.wpi.edu/~dance/blahdocs/uploads/didrex_7351.htm didrex online] [http://users.wpi.edu/~dance/blahdocs/uploads/ultracet_6057.htm cheap ultracet] [http://users.wpi.edu/~dance/blahdocs/uploads/hydrocodone_7117.htm cheap hydrocodone] [http://students.hsc.unt.edu/housing/item.cfm?type=2879 clomid online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30366 jazz ringtones] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/cyclobenzaprine_72.htm cyclobenzaprine online] [http://library.cshl.edu/wp/vb/member.php?u=1340 soma online] [http://library.cshl.edu/wp/vb/member.php?u=1379 music ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=222 cheap vigrx] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3704 cheap lorazepam] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=86 fioricet online] [http://students.hsc.unt.edu/housing/item.cfm?type=2863 alprazolam online] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3771 cool ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3707 cheap nexium] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/mpringtones_1668.htm mp3 ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=190 cheap lisinopril] [http://library.cshl.edu/wp/vb/member.php?u=1373 free nextel ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3761 free free ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a32 zoloft] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3722 qwest ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2853 fioricet online] [http://users.wpi.edu/~dance/blahdocs/uploads/xenical_848.htm cheap xenical] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30339 free samsung ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=160 cheap adipex] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=108 nexium online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=107 music ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a15 kyocera ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2872 online cyclobenzaprine] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=232 free sony ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a26 free sharp ringtones] [http://users.wpi.edu/~dance/blahdocs/uploads/levitra_1783.htm cheap levitra] [http://students.hsc.unt.edu/housing/item.cfm?type=2878 cheap sildenafil] [http://students.hsc.unt.edu/housing/item.cfm?type=2894 buy flexeril] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=110 free nokia ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a07 tracfone ringtones] [http://wc1.worldcrossing.com/WebX/.1de609e0 cheap ativan] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3744 buy clonazepam] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3736 soma online] [http://students.hsc.unt.edu/housing/item.cfm?type=2923 free sony ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30361 free kyocera ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2852 buy xanax] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=100 lortab online] [http://students.hsc.unt.edu/housing/item.cfm?type=2865 paxil online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30323 flexeril] [http://wc1.worldcrossing.com/WebX/.1de609ec buy hgh] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3697 cheap diazepam] [http://wc1.worldcrossing.com/WebX/.1de60a01 free sagem ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3774 free ericsson ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30355 punk ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a03 sony ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2893 cheap hgh] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3742 adipex online] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/realringtones_1857.htm free real ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30250 viagra online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30354 free alltel ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2898 free ringtones] [[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?