Template:Sandbox: Difference between revisions

From OLPC
Jump to navigation Jump to search
mNo edit summary
(reorganize)
 
(42 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
Often you need to test an idea for a template, so try it out here.
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).


: 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). -- [[User:Xavi]]
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.


The idea of this {{tl|Sandbox}} page is to have that, a simple testing template 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
[[Category:Template]]


If you try out the template here, you have to save the template and then preview to see how it works. You can instead edit [[Test sandbox template]].
: <big>'''Testing Task<strike></strike>'''</big>


'''See Also''' http://meta.wikimedia.org/wiki/Help:Template
</noinclude>
[[Category:Template]]
<includeonly>
{| cellpadding="2" cellspacing="0" style="float:right; border:1px solid #aaa; font-size:small; background:#f9f9f9; width:15em; margin:5px 0px 5px 5px;"
|-
| colspan="2" style="font-size:larger; text-align:center; background:#3b9fca; color:white" | '''Task: {{{name|<tt>un-named</tt>}}}'''
|-
| style="text-align:right;" | '''Duration:'''
| style="text-align:left;" | {{{duration}}}&nbsp;{{{unit}}}
|-
| style="text-align:right;" | '''Category:'''
| style="text-align:left;" | {{{category}}}
|}
[[Category:{{{category}}}]]
[[Category:{{{unit}}}]]
</includeonly><noinclude>


''Please leave this comment/text above for others to read.''
Purpose of this template is to organize [[:Category:Tasks]] in a homogeneous way, according to the guidelines mentioned in [[Participate]].
----


: <big>'''Testing: subpage parsing'''</big>
Pages tagged with this will be included in the following categories:


; Goal
* [[:Category:Tasks]]
: Given "Feature roadmap/Name of feature", return "Name of feature"
* According to its ''category'' parameter:
: Given "Just a title", return "Just a title"
** [[:Category:Programming]]
** [[:Category:Education]]
** [[:Category:Organizing]]
** [[:Category:Translation]]
** [[:Category:Other]]
* According to its ''unit'' parameter:
** [[:Category:minutes]]
** [[:Category:hours]]
** [[:Category:days]]
** [[:Category:weeks]]
** [[:Category:months]]
** [[:Category:years]]


</noinclude>
== Usage ==
{{#sub:
{{{1}}} |
{{#if: {{#pos:{{{1}}}|/}} |
{{#expr: {{#pos:{{{1}}}|/}} + 1}} |
{{#pos:{{{1}}}|/}}
}}
}}


pos={{#pos:{{{1}}}|/}}
<nowiki>{{</nowiki> Task
iftest={{#if: {{#pos:{{{1}}}|/}} |
| name = &lt;!-- OPTIONAL -- some name for the task at hand --&gt;
yes |
| duration = &lt;!-- a number denoting the estimated time required --&gt;
no
| unit = &lt;!-- { minutes | hours | days | weeks | months | years } --&gt;
}}
| category = &lt;!-- { Programming | Education | Organizing | Translation | Other } --&gt;
<nowiki>}}</nowiki>

== Samples ==

<br clear="all">
{{ Sandbox | duration = 8 | unit = hours | category = Programming }}
<nowiki>{{ Sandbox | duration = 8 | unit = hours | category = Programming }}</nowiki>
<br clear="all">
{{ Sandbox | name = Testing | duration = 5 | unit = days | category = Organizing }}
<nowiki>{{ Sandbox | name = Testing | duration = 8 | unit = hours | category = Programming }}</nowiki>
</noinclude>

Latest revision as of 01:31, 16 March 2009

Often you need to test an idea for a template, so try it out here.

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). -- User:Xavi

The idea of this {{Sandbox}} page is to have that, a simple testing template that will not interfere with others and avoid leaving a trail of botched attempts.

If you try out the template here, you have to save the template and then preview to see how it works. You can instead edit Test sandbox template.

See Also http://meta.wikimedia.org/wiki/Help:Template

Please leave this comment/text above for others to read.


Testing: subpage parsing
Goal
Given "Feature roadmap/Name of feature", return "Name of feature"
Given "Just a title", return "Just a title"


{{#sub:

 {{{1}}} |
 Expression error: Unrecognized punctuation character "{".

}}

pos={{#pos:{{{1}}}|/}} iftest=yes