Template:CatWeight/doc: Difference between revisions
Jump to navigation
Jump to search
m (→Syntax) |
m (→The Weights) |
||
Line 34: | Line 34: | ||
==Examples== | ==Examples== | ||
===The Weights=== | ===The Weights=== | ||
{{catWeight| | {{catWeight|misc|0|Weight <tt> </tt> for <tt><nowiki><color> = misc, <weight> = 0</nowiki></tt>.}} | ||
{{catWeight| | {{catWeight|amount|1|Weight <tt>+ </tt> for <tt><nowiki><color> = amount, <weight> = 1</nowiki></tt>.}} | ||
{{catWeight| | {{catWeight|worstcase|2|Weight <tt>* </tt> for <tt><nowiki><color> = worstcase, <weight> = 2</nowiki></tt>.}} | ||
{{catWeight| | {{catWeight|onoff|3|Weight <tt>*+ </tt> for <tt><nowiki><color> = onoff, <weight> = 3</nowiki></tt>.}} | ||
{{catWeight| | {{catWeight|misc|4|Weight <tt>** </tt> for <tt><nowiki><weight> = 4</nowiki></tt>.}} | ||
{{catWeight| | {{catWeight|misc|5|Weight <tt>**+</tt> for <tt><nowiki><weight> = 5</nowiki></tt>.}} | ||
{{catWeight| | {{catWeight|misc|6|Weight <tt>***</tt> for <tt><nowiki><weight> = 6</nowiki></tt>.}} | ||
{{catWeight| | {{catWeight|misc|1-5|Weight <tt>+ to **+</tt> for <tt><nowiki><weight> = 1-5</nowiki></tt>.}} | ||
{{catWeight| | {{catWeight|misc|1-6|Weight <tt>+ to ***</tt> for <tt><nowiki><weight> = 1-6</nowiki></tt>.}} | ||
===Indentation=== | ===Indentation=== |
Revision as of 13:21, 2 May 2009
Documentation for this template
This template creates an eye-catcher bar that can be indented up to 6 times via parameter value, letting the user better customize his "Note"s. The code is backwards compatible, letting the user keep on using the old 2 parameter version as well.
New Subtle one-pixel border added, padding improved, <weight> is not word-wrapped.
Alternative names
- {{catWeight|<colour>|<weight>|<text>}}
- {{CatWeight|<colour>|<weight>|<text>}} - alternate spelling of template
- {{catWeight|<#>|<colour>|<weight>|<text>}}
- {{CatWeight|<#>|<colour>|<weight>|<text>}} - alternate spelling of template
Syntax
The template can have 3 or 4 parameters:
- {{catWeight|<colour>|<weight>|<text>}} - Default mode, no indentation.
- {{catWeight|<#>|<colour>|<weight>|<text>}} - Define indentation via <#> parameter.
<#> = Number 0 (min) to 6 (max), defines indentation level. <colour> = Define the colour type of the info box: onoff = red-ish... use to match {{catWeightInfo|onoff}} worstcase = yellow-ish... use to match {{catWeightInfo|worstcase}} amount = green-ish... use to match {{catWeightInfo|amount}} misc = purple-ish... (fun, testing), the default colour! <weight> = The category weight denominator (not word-wrapped), range: 1 for "+" to 6 for "***" 1-5 for "+ to **+" 1-6 for "+ to ***" <text> = The descriptive text for that weight level.
Note Only the <#> values 1 to 6 are actually checked, any other values (e.g. 0 or abc) yield no indentation at all, and are treated the same as {{eyecatch|info|text}}!
Examples
The Weights
Category Weight | Weight for <color> = misc, <weight> = 0. |
Category Weight | + | Weight + for <color> = amount, <weight> = 1. |
Category Weight | * | Weight * for <color> = worstcase, <weight> = 2. |
Category Weight | *+ | Weight *+ for <color> = onoff, <weight> = 3. |
Category Weight | ** | Weight ** for <weight> = 4. |
Category Weight | **+ | Weight **+ for <weight> = 5. |
Category Weight | *** | Weight *** for <weight> = 6. |
Category Weight | + to **+ | Weight + to **+ for <weight> = 1-5. |
Category Weight | + to *** | Weight + to *** for <weight> = 1-6. |
Indentation
{{catWeight|0|0|'''No''' indentation or weight.}}
Category Weight | No indentation or weight. |
{{catWeight|1|1|'''One''' indentation and weight.}}
Category Weight | + | One indentation and weight. |
{{catWeight|2|2|Level '''two''' indentation and weight!}}
Category Weight | * | Level two indentation and weight! |
{{catWeight|6|6|Maximum indentation level of '''six''', same weight!}}
Category Weight | *** | Maximum indentation level of six, same weight! |
Test the Code
Should more code testing be required see the Template:CatWeight/Test Code page.