Template:Sandbox: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (tweaking)
(trying future Template PyMethod)
Line 8: Line 8:
[[Category:Template]]
[[Category:Template]]
</noinclude>
</noinclude>

{{Translation | lang = {{{lang}}} | source = {{{source}}} | version = {{{version}}}
<div style="border-top:1px solid #888888; border-bottom:1px solid #888888; margin:0px;">
| source_display = {{{source_display|}}} | version_display = {{{version_display|}}} | diff_display = {{{diff_display|}}}}}
{| width="100%" cellpadding="0" cellspacing="0" <!-- style="background-color:#0093d0; color:white" -->
<includeonly>
|-
[[Category:PO files|{{{lang}}}]] [[Category:Laptop.org|{{{lang}}}]]
| align=center | '''IN'''
Category:PO files|{{{lang}}} Category:Laptop.org|{{{lang}}}
| align=center | '''{{{method}}}'''
</includeonly>
| algin=center | '''OUT'''
|-
| {{{in}}}
| {{{comment}}}
| {{{out}}}
|}
</div>
<noinclude>
<noinclude>


: <big>'''Trying to nest template Template:Translation<strike></strike>'''</big>
: <big>'''Testing new template Template:PyMethod<strike></strike>'''</big>


== usage ==
== usage ==


<nowiki>{{</nowiki> Sandbox
<nowiki>{{</nowiki> Sandbox
| lang = &lt;-- 2/3 character language-code of the translation&mdash;ie: <tt>en, es, ...</tt> --&gt;
| method = &lt;-- name of the function/method --&gt;
| source = &lt;-- Source page name&mdash;ie: "<tt>The OLPC Wiki</tt>" (sans quotes) --&gt;
| comment = &lt;-- description of the method --&gt;
| version = &lt;-- Version ID# of the edition being translated or last updated --&gt;
| in = &lt;-- list of arguments / parameters --&gt;
| source_display = &lt;-- OPTIONAL - a string to display the source link above
| ''in_notes'' = &lt;-- OPTIONAL - notes on the arguments / parameters --&gt;
default = value of ''source'' --&gt;
| out = &lt;-- return value --&gt;
| version_display = &lt;-- OPTIONAL - a string to display for the link to the version translated
| ''out_notes'' = &lt;-- OPTIONAL - notes on the returned value --&gt;
default = "<tt>original</tt>" --&gt;
| diff_display = &lt;-- OPTIONAL - string to display the link to the version translated and current
default = "<tt>diff</tt>" --&gt;
<nowiki>}}</nowiki>
<nowiki>}}</nowiki>


== samples ==
== samples ==


<nowiki>{{</nowiki> Sandbox | lang = es | source = The OLPC Wiki | version = 30534 <nowiki>}}</nowiki>
<nowiki>{{</nowiki> Sandbox
| method = ShareActivity
{{ Sandbox | lang = es | source = The OLPC Wiki | version = 30534 }}
| in = s: activity id, s: activity type, s: name, a{sv}: properties
<nowiki>{{</nowiki> Sandbox | lang = es | source = The OLPC Wiki | version = 30534
| out = o
| source_display = original | version_display = versión traducida | diff_display = últimos cambios <nowiki>}}</nowiki>
| comment = Shares an activity with others
{{ Sandbox | lang = es | source = The OLPC Wiki | version = 30534
<nowiki>}}</nowiki>
| source_display = original | version_display = versión traducida | diff_display = últimos cambios }}
{{Sandbox
| method = ShareActivity
| in = s: activity id, s: activity type, s: name, a{sv}: properties
| out = o
| comment = Shares an activity with others }}
</noinclude>
</noinclude>

Revision as of 19:58, 13 April 2007

Many times you may want to just 'test' an idea for a template, I haven't found a sensible way of fully testing templates by themselves (as they will not get included in the edited version, but rather the saved version).

The idea of this Template:Sandbox is to have that, a simple testing zone that will not interfere with others and avoid leaving a trail of botched attempts.

Please leave this comment/text for others to read.
See Also http://meta.wikimedia.org/wiki/Help:Template


IN {{{method}}} OUT
{{{in}}} {{{comment}}} {{{out}}}


Testing new template Template:PyMethod

usage

{{ Sandbox
   | method     =  <-- name of the function/method -->
   | comment    =  <-- description of the method -->
   | in         =  <-- list of arguments / parameters -->
   | in_notes   =  <-- OPTIONAL - notes on the arguments / parameters -->
   | out        =  <-- return value -->
   | out_notes  =  <-- OPTIONAL - notes on the returned value -->
}}

samples

{{ Sandbox 
   | method = ShareActivity 
   | in = s: activity id, s: activity type, s: name, a{sv}: properties
   | out = o
   | comment = Shares an activity with others
}}


IN ShareActivity OUT
s: activity id, s: activity type, s: name, a{sv}: properties Shares an activity with others o