Template:Sandbox: Difference between revisions
Jump to navigation
Jump to search
m (tweaking) |
(reorganize) |
||
(24 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 --> |
|||
{{ #if: {{{icon|}}} | |
|||
{{!}}- |
|||
{{!}} colspan="2" style="valign:middle; padding:5px"{{!}} [[Image:{{{icon}}}|center]] }} <!-- ENDIF icon --> <!-- |
|||
IF status --> |
|||
{{ #if: {{{status|}}} | |
|||
{{!}}- |
|||
{{!}} style="text-align:right;" {{!}} '''Status:''' |
|||
{{!}} style="text-align:left;" {{!}} {{{status}}} }} <!-- ENDIF status --> <!-- |
|||
IF source --> {{ #if: {{{source|}}} | <!-- |
|||
IF build --> {{ #if: {{{build|}}} | |
|||
{{!}}- |
|||
{{!}} style="text-align:right;" {{!}} '''Build:''' |
|||
{{!}} style="text-align:left;" {{!}} {{{build}}} }} <!-- ENDIF build --> |
|||
{{!}}- |
|||
{{!}} style="text-align:right;" {{!}} '''Source:''' |
|||
{{!}} style="text-align:left;" {{!}} {{{source}}} <!-- |
|||
IF language --> {{ #if: {{{language|}}} | |
|||
{{!}}- |
|||
{{!}} style="text-align:right;" {{!}} '''Language:''' |
|||
{{!}} style="text-align:left;" {{!}} {{{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>''}}} }} }} <!-- ENDIF l10n --> }} <!-- 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}}}}} }} <!-- 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}}}]]. |
|||
; Goal |
|||
Many of the 'parameters' only make sense under certain circumstances (ie: no point in mentioning l10n if there's no source code). |
|||
: Given "Feature roadmap/Name of feature", return "Name of feature" |
|||
: Given "Just a title", return "Just a title" |
|||
</noinclude> |
|||
== Usage == |
|||
{{#sub: |
|||
{{{1}}} | |
|||
{{#if: {{#pos:{{{1}}}|/}} | |
|||
{{#expr: {{#pos:{{{1}}}|/}} + 1}} | |
|||
{{#pos:{{{1}}}|/}} |
|||
}} |
|||
}} |
|||
pos={{#pos:{{{1}}}|/}} |
|||
<nowiki>{{</nowiki>Status box |
|||
iftest={{#if: {{#pos:{{{1}}}|/}} | |
|||
| ''component'' = <!-- OPTIONAL -- Name of the component (defaults to page title) --> |
|||
yes | |
|||
| type = <!-- Type of the component {activity, core, support} --> |
|||
no |
|||
| ''icon'' = <!-- OPTIONAL -- ''file name.ext'' (sans <tt><nowiki>[[Image:</nowiki>''file name.ext''<nowiki>]]</nowiki></tt> --> |
|||
}} |
|||
| 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 --> |
|||
| [[:Category:Test Plans|''testplan'']] = <!-- OPTIONAL -- link to the [[:Category:Test Plans|test plan page]] --> |
|||
| contributors = <!-- People contributing to the activity --> |
|||
| <s>version = <!-- Current/latest version available --></s>''dropping it'' |
|||
| <s>base = <!-- Yes/No if it's included in the [[OS images]] |
|||
/ Could be the first ''build'' number --></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