Template:Sandbox: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (tweaking)
(reorganize)
 
(26 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}}}
<!--
IF source -->
{{ #if: {{{source|}}} | <!--
IF build -->
{{ #if: {{{build|}}} |


; Goal
{{!}}-
: Given "Feature roadmap/Name of feature", return "Name of feature"
{{!}} style="text-align:right;" {{!}} '''Build:'''
: Given "Just a title", return "Just a title"
{{!}} style="text-align:left;" {{!}} {{{build}}} | <!--
ELSE build --> }} <!-- ENDIF build -->


</noinclude>
{{!}}-
{{#sub:
{{!}} style="text-align:right;" {{!}} '''Source:'''
{{{1}}} |
{{!}} style="text-align:left;" {{!}} {{{source}}} <!--
{{#if: {{#pos:{{{1}}}|/}} |
IF language -->
{{ #if: {{{language|}}} |
{{#expr: {{#pos:{{{1}}}|/}} + 1}} |
{{#pos:{{{1}}}|/}}
}}
}}


pos={{#pos:{{{1}}}|/}}
{{!}}-
iftest={{#if: {{#pos:{{{1}}}|/}} |
{{!}} style="text-align:right;" {{!}} '''Language:'''
yes |
{{!}} style="text-align:left;" {{!}} {{{language}}} | <!--
no
ELSE language --> }} <!-- ENDIF language --> <!--
}}
IF l10n -->
{{ #if: {{{l10n|}}} |

{{!}}-
{{!}} 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>''}}} }} | <!--
ELSE l10n --> }} <!-- ENDIF l10n --> | <!--
ELSE source --> }} <!-- ENDIF source --> <!--
IF testplan -->
{{ #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}}}}} | <!--
ELSE testplan --> }} <!-- ENDIF 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}}}]].

Many of the 'parameters' only make sense under certain circumstances (ie: no point in mentioning l10n if there's no source code).

== Usage ==

<nowiki>{{</nowiki>Status box
| ''component'' = &lt;!-- OPTIONAL -- Name of the component (defaults to page title) --&gt;
| type = &lt;!-- Type of the component {activity, core, support} --&gt;
| ''icon'' = &lt;!-- OPTIONAL -- ''file name.ext'' (sans <tt><nowiki>[[Image:</nowiki>''file name.ext''<nowiki>]]</nowiki></tt> --&gt;
| status = &lt;!-- Status of the activity --&gt;
| ''build'' = &lt;!-- OPTIONAL -- Build # where it first appeared --&gt;
| ''source'' = &lt;!-- OPTIONAL -- Repository / location of the source --&gt;
| ''language'' = &lt;!-- OPTIONAL -- Computer language of the ''source'' --&gt;
| ''l10n'' = &lt;!-- OPTIONAL -- 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;
| <s>version = &lt;!-- Current/latest version available --&gt;</s>''dropping it''
| <s>base = &lt;!-- Yes/No if it's included in the [[OS images]]
/ Could be the first ''build'' number --&gt;</s>''dropping it''
<nowiki>}}</nowiki>

== Sample ==

=== Empty ===
Raw invocation.
<br clear="all">
{{ Sandbox }}
<nowiki>{{</nowiki> Sandbox <nowiki>}}</nowiki>
; Notes : Nothing else should show.

; Simplest : Basically an idea; using the page name; and misclassified by type, so defaults to a ''<tt>Unknown Component</tt>''. Nothing else should show.
<br clear="all">{{ Sandbox | type = Bar }}
<nowiki>{{</nowiki> Sandbox
| type = Bar
<nowiki>}}</nowiki>

; Simple 1 : Basically an idea; using the page name; and misclassified by type.
<br clear="all">{{ Sandbox | type = activity }}
<nowiki>{{</nowiki> Sandbox
| type = activity
<nowiki>}}</nowiki>
; Notes : the ''type'' is recognized. Nothing else should show.

; Simple 2 : Basically an idea for a named component of the activity type, and an icon.
<br clear="all">{{ Sandbox | component = Foo | type = activity | icon = Xo s.png }}
<nowiki>{{</nowiki> Sandbox
| component = Foo
| type = activity
| icon = Xo s.png
<nowiki>}}</nowiki>

; Simple 3 : An activity idea that has code and an icon, in beta status, with l10n resources
<br clear="all">{{ Sandbox | component = Foo | type = activity | icon = Xo s.png | source = [[foo]] | l10n = [[Localization]] | status = beta }}
<nowiki>{{</nowiki> Sandbox
| component = Foo
| type = activity
| icon = Xo s.png
| source = [[foo]]
| l10n = <nowiki>[[Localization]]</nowiki>
| status = beta
<nowiki>}}</nowiki>

[[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