Template:Sandbox: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (tweaking)
(reorganize)
 
(34 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: Status box<strike></strike>'''</big>


'''See Also''' http://meta.wikimedia.org/wiki/Help:Template
</noinclude>
[[Category:Template]]


''Please leave this comment/text above for others to read.''
{| cellpadding="2" cellspacing="0" style="float:right; border:1px solid #aaa; font-size:small; background:#f9f9f9; width:15em; margin:5px 0px 5px 5px;"
----


: <big>'''Testing: subpage parsing'''</big>
|-
| colspan="2" style="font-size:large; text-align:center; background:#6bbe45; color:white" | '''{{{component|{{PAGENAME}}}}}'''<span style="font-size:small;"><br>[[:Category:{{{type|activity}}}|({{{type|activity}}})]]</span>
{{ #if: {{{icon|}}} | {{!}}-
{{!}} colspan="2" style="valign:middle; padding:5px"{{!}} [[Image:{{{icon}}}{{!}}center]] |}}
|-
| style="text-align:right;" | '''Status:'''
| style="text-align:left;" | {{{status}}}


; Goal
|-
: Given "Feature roadmap/Name of feature", return "Name of feature"
| style="text-align:right;" | '''Version:'''
: Given "Just a title", return "Just a title"
| style="text-align:left;" | {{{version}}}


</noinclude>
|-
{{#sub:
| style="text-align:right;" | '''Base:'''
{{{1}}} |
| style="text-align:left;" | {{{base}}}
{{#if: {{#pos:{{{1}}}|/}} |
{{#expr: {{#pos:{{{1}}}|/}} + 1}} |
{{#pos:{{{1}}}|/}}
}}
}}


pos={{#pos:{{{1}}}|/}}
|-
iftest={{#if: {{#pos:{{{1}}}|/}} |
| style="text-align:right;" | '''Source:'''
yes |
| style="text-align:left;" | {{{source}}}
no
{{ #if: {{{language}}} | {{!}}-
}}
{{!}} style="text-align:right;" {{!}} '''Language:'''
{{!}} style="text-align:left;" {{!}} {{{language}}}
|}}
|-
| style="text-align:right;" | '''[[Localization|l10n]]:'''
| style="text-align:left;" | {{ #ifexist: {{PAGENAME}}/Localization|[[{{PAGENAME}}/Localization]]|{{{l10n|''<span class="plainlinks">[{{fullurl:{{PAGENAME}}}}/Localization add it here]</span>''}}} }}
{{ #if: {{{testplan|{{#ifexist:{{PAGENAME}}/Test plan|gotpage}}}}} | {{!}}-
{{!}} style="text-align:right;" {{!}} '''[[:Category:Test Plans|Test plans]]:'''
{{!}} style="text-align:left;" {{!}} {{#ifexist:{{PAGENAME}}/Test plan|[[{{PAGENAME}}/Test plan]]|{{{testplan}}}}}
|}}
|-
| colspan="2" style="text-align:center;" | '''Contributors'''

|-
| colspan="2" style="text-align:center" | {{{contributors}}}
|}
<!-- CATEGORIZATION -- TESTING -->
Testing parameterized categorizations:
<!-- CATEGORIZATION -- type -->
<nowiki>[[</nowiki>Category:{{ #switch: {{lc:{{{type}}}}} | activity=Activity | core=Core | #default=Unknown Component }}<nowiki>]]</nowiki>
''type => {{{type}}} | {{lc:{{{type}}}}}''
<!-- CATEGORIZATION -- type & source & status -->
<nowiki>[[</nowiki>Category:{{ #if: {{{source|}}} | {{ #switch: {{lc:{{{type}}}}} | activity=Activity | core=Core | #default=Unknown Component }} {{{status}}} | Software idea }}<nowiki>]]</nowiki>
''source => {{{source}}} | {{ #if: {{{source|}}} | has source | no source }}''
''type => {{{type}}} | {{lc:{{{type}}}}}''
''status => {{{status}}} | {{lc:{{{status}}}}}''
<!-- CATEGORIZATION -- l10n -->
<nowiki>[[</nowiki>Category:{{ #if: {{{l10n|}}} | l10n | Pending i18n }}<nowiki>]]</nowiki>
''l10n => {{{l10n}}}''


<includeonly>[[Category:Activity]]</includeonly><noinclude>
This template automatically includes the page in the <nowiki>[[:Category:</nowiki>{{{type}}}]].

== Usage ==

<nowiki>{{</nowiki>Status box
| component = &lt;!-- Name of the component --&gt;
| type = &lt;!-- Type of the component {activity, core, support} --&gt;
| icon = &lt;!-- ''file name.ext'' (sans <tt><nowiki>[[Image:</nowiki>''file name.ext''<nowiki>]]</nowiki></tt> --&gt;
| status = &lt;!-- Status of the activity --&gt;
| version = &lt;!-- Current/latest version available --&gt;
| base = &lt;!-- Yes/No if it's included in the [[OS images]]
/ Could be the first ''build'' number --&gt;
| source = &lt;!-- Repository / location of the source --&gt;
| ''language'' = &lt;!-- OPTIONAL -- Computer language of the ''source'' --&gt;
| l10n = &lt;!-- Repository / location of the l10n resources --&gt;
| [[:Category:Test Plans|''testplan'']] = &lt;!-- OPTIONAL -- link to the [[:Category:Test Plans|test plan page]] --&gt;
| contributors = &lt;!-- People contributing to the activity --&gt;
<nowiki>}}</nowiki>

== Sample ==

<br clear="all">
{{ Sandbox | component = Foo | type = Bar | icon = Xo s.png | testplan = [[some page]] }}
<nowiki>{{</nowiki> Sandbox
| component = Foo
| type = Bar
| icon = Xo s.png
| testplan = <nowiki>[[some page]]</nowiki>
<nowiki>}}</nowiki>
; Notes : the ''type'' is not recognized, so defaults to a general one, ''testplan'' shows because it has one specified, ''icon'' shows, goes into ''pending 18n'' as no ''l10n'' resource is given.

<br clear="all">
{{ Sandbox | type = Activity | status = beta | l10n = [[Localization]] }}
<nowiki>{{</nowiki> Sandbox
| type = activity
| status = beta
| l10n = <nowiki>[[Localization]]</nowiki>
<nowiki>}}</nowiki>
; Notes : Taking the ''component'' name from the <nowiki>{{PAGENAME}}</nowiki>, ''icon'' is undefined. Goes into the l10n category, as it can be l10n'ed.

[[Category:Template]]
</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