Template:Sandbox: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (tweaking)
m (tweaking)
Line 23: Line 23:
<!--
<!--
IF source -->
IF source -->
{{ #if: {{{source|foo}}} | <!--
{{ #if: {{{source|}}} | <!--
IF build -->
IF build -->
{{ #if: {{{build|}}} |
{{ #if: {{{build|}}} |
Line 67: Line 67:
Testing parameterized categorizations:
Testing parameterized categorizations:
<!-- CATEGORIZATION -- type -->
<!-- CATEGORIZATION -- type
<nowiki>[[</nowiki>Category:{{ #switch: {{lc:{{{type}}}}} | activity=Activity | core=Core | #default=Unknown Component }}<nowiki>]]</nowiki>
<nowiki>[[</nowiki>Category:{{ #switch: {{lc:{{{type}}}}} | activity=Activity | core=Core | #default=Unknown Component }}<nowiki>]]</nowiki>
''type => {{{type}}} | {{lc:{{{type}}}}}''
''type => {{{type}}} | {{lc:{{{type}}}}}''
-->
<!-- CATEGORIZATION -- type & source & status -->
<!-- CATEGORIZATION -- type & source & status -->
<nowiki>[[</nowiki>Category:{{ #if: {{{source|}}} | {{ #switch: {{lc:{{{type}}}}} | activity=Activity | core=Core | #default=Unknown Component }} {{{status}}} | Software idea }}<nowiki>]]</nowiki>
<nowiki>[[</nowiki>Category:{{ #if: {{{source|}}} | {{ #switch: {{lc:{{{type}}}}} | activity=Activity | core=Core | #default=Unknown Component }} {{{status}}} | Software idea }}<nowiki>]]</nowiki>
Line 75: Line 76:
''type => {{{type}}} | {{lc:{{{type}}}}}''
''type => {{{type}}} | {{lc:{{{type}}}}}''
''status => {{{status}}} | {{lc:{{{status}}}}}''
''status => {{{status}}} | {{lc:{{{status}}}}}''
<!-- CATEGORIZATION -- l10n -->
<!-- CATEGORIZATION -- l10n
<nowiki>[[</nowiki>Category:{{ #if: {{{l10n|}}} | l10n | Pending i18n }}<nowiki>]]</nowiki>
<nowiki>[[</nowiki>Category:{{ #if: {{{l10n|}}} | l10n | Pending i18n }}<nowiki>]]</nowiki>
''l10n => {{{l10n}}}''
''l10n => {{{l10n}}}''
-->


<includeonly>[[Category:Activity]]</includeonly><noinclude>
<includeonly>[[Category:Activity]]</includeonly><noinclude>
This template automatically includes the page in the <nowiki>[[:Category:</nowiki>{{{type}}}]].
This template automatically includes the page in the <nowiki>[[:Category:</nowiki>{{{type}}}]].
Line 107: Line 107:
=== Empty ===
=== Empty ===
Raw invocation.
Raw invocation.

<br clear="all">
<br clear="all">
{{ Sandbox }}
{{ Sandbox }}
Line 114: Line 113:
; Notes : Nothing else should show.
; 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.
=== Simplest ===
<br clear="all">{{ Sandbox | type = Bar }}
Basically an idea; using the page name; and misclassified by type.

<br clear="all">
{{ Sandbox | type = Bar }}
<nowiki>{{</nowiki> Sandbox
<nowiki>{{</nowiki> Sandbox
| type = Bar
| type = Bar
<nowiki>}}</nowiki>
<nowiki>}}</nowiki>
; Notes : the ''type'' is not recognized, so defaults to a ''<tt>Unknown Component</tt>''. Nothing else should show.


; Simple 1 : Basically an idea; using the page name; and misclassified by type.
=== Simple 1 ===
<br clear="all">{{ Sandbox | type = activity }}
Basically an idea; using the page name; and misclassified by type.

<br clear="all">
{{ Sandbox | type = activity }}
<nowiki>{{</nowiki> Sandbox
<nowiki>{{</nowiki> Sandbox
Line 136: Line 128:
; Notes : the ''type'' is recognized. Nothing else should show.
; 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.
=== Simple 2 ===
<br clear="all">{{ Sandbox | component = Foo | type = activity | icon = Xo s.png }}
Basically an idea; not using the page name; and classified by type.

<br clear="all">
{{ Sandbox | component = Foo | type = activity | icon = Xo s.png }}
<nowiki>{{</nowiki> Sandbox
<nowiki>{{</nowiki> Sandbox
Line 147: Line 136:
| icon = Xo s.png
| icon = Xo s.png
<nowiki>}}</nowiki>
<nowiki>}}</nowiki>
; Notes : specifying a name for the component, the ''type'' is recognized. Apart from the icon, nothing else should show.


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

<br clear="all">
{{ Sandbox | component = Foo | type = activity | icon = Xo s.png | source = [[foo]] }}
<nowiki>{{</nowiki> Sandbox
<nowiki>{{</nowiki> Sandbox
Line 160: Line 145:
| icon = Xo s.png
| icon = Xo s.png
| source = [[foo]]
| source = [[foo]]
<nowiki>}}</nowiki>
; Notes : specifying a name for the component, the ''type'' is recognized. Apart from the icon, nothing else should show.

== 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>
| 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.

=== Sample Full? ===
<br clear="all">
{{ Sandbox | component = original name |icon = Xo s.png | testplan = [[some plan]] | type = Activity | status = beta | source = [[foo]] | l10n = [[Localization]] | contributors = Xavier, [[User:Xavi|Xavi]]}}
<nowiki>{{</nowiki> Sandbox
| type = activity
| status = beta
| status = beta
| source = [[foo]]
| l10n = <nowiki>[[Localization]]</nowiki>
<nowiki>}}</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]]
[[Category:Template]]

Revision as of 03:15, 1 July 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
Testing: Status box


Sandbox
(activity)
Status: {{{status}}}


Contributors
{{{contributors}}}
Testing parameterized categorizations:

[[Category:Software idea]]
    source => {{{source}}} | no source
    type => {{{type}}} | {{{type}}}
    status => {{{status}}} | {{{status}}}

This template automatically includes the page in the [[:Category:{{{type}}}]].

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

Usage

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

Sample

Empty

Raw invocation.


Sandbox
(activity)
Status: {{{status}}}


Contributors
{{{contributors}}}
Testing parameterized categorizations:

[[Category:Software idea]]
    source => {{{source}}} | no source
    type => {{{type}}} | {{{type}}}
    status => {{{status}}} | {{{status}}}

{{ Sandbox }}
Notes
Nothing else should show.
Simplest
Basically an idea; using the page name; and misclassified by type, so defaults to a Unknown Component. Nothing else should show.


Sandbox
(Bar)
Status: {{{status}}}


Contributors
{{{contributors}}}
Testing parameterized categorizations:

[[Category:Software idea]]
    source => {{{source}}} | no source
    type => Bar | bar
    status => {{{status}}} | {{{status}}}

{{ Sandbox
| type = Bar
}}
Simple 1
Basically an idea; using the page name; and misclassified by type.


Sandbox
(activity)
Status: {{{status}}}


Contributors
{{{contributors}}}
Testing parameterized categorizations:

[[Category:Software idea]]
    source => {{{source}}} | no source
    type => activity | activity
    status => {{{status}}} | {{{status}}}

{{ Sandbox
| type = activity
}}
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.


Foo
(activity)
Xo s.png
Status: {{{status}}}


Contributors
{{{contributors}}}
Testing parameterized categorizations:

[[Category:Software idea]]
    source => {{{source}}} | no source
    type => activity | activity
    status => {{{status}}} | {{{status}}}

{{ Sandbox
| component = Foo
| type = activity
| icon = Xo s.png
}}
Simple 3
An activity idea that has code and an icon, in beta status, with l10n resources


Foo
(activity)
Xo s.png
Status: beta
Source: foo
l10n: Localization


Contributors
{{{contributors}}}
Testing parameterized categorizations:

[[Category:Activity beta]]
    source => foo | has source
    type => activity | activity
    status => beta | beta

{{ Sandbox
| component = Foo
| type = activity
| icon = Xo s.png
| source = foo
| l10n = [[Localization]]
| status = beta
}}