1,633
edits
m (Cleaned up description for CatWeight (code not final though)) |
mNo edit summary |
||
(22 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{TOCright}} | {{TOCright}} | ||
This template creates an ''category weight bar'' that can be indented up to six times via parameter value. It can also be colour coded, a weight can be defined, and you can add a message describing the weight choice. | |||
{{eyecatch|1|Features|Indentation of up to 6 levels, colours, and weight ranges.}} | |||
This template creates an '' | |||
{{eyecatch|1| | |||
==Syntax== | ==Syntax== | ||
The template can have ''' | The template can have '''3''' or '''4 parameters''': | ||
# | #{{m|catWeight|<colour>|<weight>|<text>}} - Default mode, no indentation. | ||
# | #{{m|catWeight|<#>|<colour>|<weight>|<text>}} - Define indentation via <#> parameter. | ||
'''<#>''' = Number '''0''' (min) to '''6''' (max), defines indentation level. | '''<#>''' = Number '''0''' (min) to '''6''' (max), defines indentation level. | ||
'''<weight>''' = The category weight denominator (not word-wrapped), range '''1''' | |||
'''<colour>''' = Define the colour type of the info box: | |||
'''onoff''' = yellow-ish... use to match <nowiki>{{catWeightInfo|onoff}}</nowiki> | |||
'''worstcase''' = red-ish... use to match <nowiki>{{catWeightInfo|worstcase}}</nowiki> | |||
'''amount''' = green-ish... use to match <nowiki>{{catWeightInfo|amount}}</nowiki> | |||
'''misc''' = purple-ish... (fun, testing), the '''default''' colour! | |||
For the most current list of available <colour>s, see [[Template:CatWcolBackground|CatWcolBackground]] | |||
or [[Template:CatWcolFrame|CatWcolFrame]] template. | |||
'''<weight>''' = The category weight denominator (not word-wrapped), range: | |||
'''1''' for "+" to '''6''' for "***" | |||
'''1-5''' for "+ to **+" | |||
'''1-6''' for "+ to ***" | |||
For a complete list of available <weight>s (and ranges), see the '''[[Template:CatWweight|CatWweight]]''' template. | |||
'''<text>''' = The descriptive text for that weight level. | '''<text>''' = The descriptive text for that weight level. | ||
'''<weight>''' = The category weight denominator (not word-wrapped), range: | |||
'''<w>''' '''1''' for "+" to '''6''' for "***" | |||
'''1-5''' for "+ to **+" | |||
'''1-6''' for "+ to ***" | |||
==Examples== | ==Examples== | ||
===The Weights=== | ===The Weights=== | ||
{{catWeight| | {{catWeight|misc|0|Weight <tt>"emtpy"</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|blue|4|Weight <tt>** </tt> for <tt><nowiki><color> = blue, <weight> = 4</nowiki></tt>.}} | ||
{{catWeight| | {{catWeight|misc|5|Weight <tt>**+</tt> for <tt><nowiki><color> = misc, <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|misc|1-6|Weight <tt>+ to ***</tt> for <tt><nowiki><weight> = 1-6</nowiki></tt>.}} | |||
===Indentation=== | ===Indentation=== | ||
<nowiki>{{catWeight|0| | <nowiki>{{catWeight|0|onoff|0|'''No''' indentation or weight.}}</nowiki> | ||
{{catWeight|0|onoff|0|'''No''' indentation or weight.}} | |||
<nowiki>{{catWeight| | <nowiki>{{catWeight|1|worstcase|1|'''One''' indentation and weight.}}</nowiki> | ||
{{catWeight| | {{catWeight|1|worstcase|1|'''One''' indentation and weight.}} | ||
<nowiki>{{catWeight| | <nowiki>{{catWeight|2|amount|2|Level '''two''' indentation and weight!}}</nowiki> | ||
{{catWeight| | {{catWeight|2|amount|2|Level '''two''' indentation and weight!}} | ||
<nowiki>{{catWeight|6|misc|6|Maximum indentation level of '''six''', same weight!}}</nowiki> | |||
{{catWeight|6|misc|6|Maximum indentation level of '''six''', same weight!}} | |||
==Test the Code== | ==Test the Code== | ||
Should more code testing be required see the [[Template:CatWeight/Test Code]] page. | Should more code testing be required see the [[Template:CatWeight/Test Code]] page. |
edits