Difference between revisions of "Template:Dot"
Storyteller (Talk | contribs) m (16 revisions) |
|||
(18 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | <includeonly>{{#iferror:{{#expr:1*{{{1|0}}}}}|{{{1|}}}|<span style="font-size:{{{fontsize|larger}}}">{{Dot/Main|{{{1|0}}}|{{{2|10}}}|separator={{{separator|}}}|fillchar={{{fillchar|{{#if:{{{boxes|}}}|■|●}}}}}|hollowchar={{{hollowchar|{{#if:{{{boxes|}}}|□|○}}}}}}}</span>}}</includeonly><noinclude> |
− | + | ||
− | + | == Usage == | |
− | + | ||
− | + | This version of the Dot template can produce all common forms of Dots or Boxes. Please note that for backwards compatibility with the old template, some default values may not be the most commonly-used values (e.g., the total number of dots). | |
− | + | ||
− | + | ||
− | + | ===Simple 5-dot Version=== | |
− | + | ||
− | }} | + | |
+ | <pre>{{Dot|3|5}}</pre> | ||
+ | |||
+ | |||
+ | {{Dot|3|5}} | ||
+ | |||
+ | |||
+ | ===Simple 10-dot Version=== | ||
+ | |||
+ | |||
+ | <pre>{{Dot|7}}</pre> | ||
+ | |||
+ | |||
+ | {{Dot|7}} | ||
+ | |||
+ | |||
+ | ===Spaced 10-dot Version=== | ||
+ | |||
+ | |||
+ | <pre>{{Dot|7|separator=1}}</pre> | ||
+ | |||
+ | |||
+ | {{Dot|7|10|separator=1}} | ||
+ | |||
+ | |||
+ | ===Simple 10-box Version=== | ||
+ | |||
+ | |||
+ | <pre>{{Dot|7|boxes=1}}</pre> | ||
+ | |||
+ | |||
+ | {{Dot|7|10|boxes=1}} | ||
+ | |||
+ | |||
+ | ===No Trailing Hollow Characters=== | ||
+ | |||
+ | |||
+ | <nowiki>{{</nowiki>Dot|3|0}} <span style="color:green">'''''(preferred)'''''</span> ''or'' <nowiki>{{</nowiki>Dot|3|5|hollowchar=}} | ||
+ | |||
+ | |||
+ | {{Dot|3|0}}<br> | ||
+ | |||
+ | |||
+ | {{Dot|3|5|hollowchar=}} | ||
+ | |||
+ | |||
+ | Please note that the first style is much easier for the wiki to produce, especially when producing 5 dots or less, and is therefore the preferred method. The second method will also work, however, and may be preferable in some situations such as a template that needs to be flexible about what parameters it's passing. | ||
+ | |||
+ | |||
+ | ===Full Parameter List=== | ||
+ | |||
+ | |||
+ | <nowiki>{{</nowiki>Dot |''number of filled dots'' (defaults to 0) |''number of total dots'' (defaults to 10) |separator=''specify any value to include a separator'' (defaults to no separator) |fontsize=''changes size of dots using CSS standards such as 12pt, small, or 150%'' (defaults to CSS "larger") |boxes=''specify any value to use boxes instead of dots'' (defaults to dots) |fillchar=''character to use as a filled dot (must be a single character with no formatting, overrides boxes setting)'' (defaults to ●) |hollowchar=''character to use as a hollow dot (must be a single character with no formatting, overrides boxes setting)'' (defaults to ○) }} ;Example <pre>{{Dot|3|10|fontsize=20pt|separator=1|fillchar=x|hollowchar=o}}</pre> {{Dot|3|10|fontsize=20pt|separator=1|fillchar=x|hollowchar=o}} </noinclude> |
Latest revision as of 12:07, 4 October 2012
Contents
Usage
This version of the Dot template can produce all common forms of Dots or Boxes. Please note that for backwards compatibility with the old template, some default values may not be the most commonly-used values (e.g., the total number of dots).
Simple 5-dot Version
{{Dot|3|5}}
{{#iferror:{{#expr:1*3}}|3|{{#ifexpr:{{#if:|1|0}} and ((3>5) or (5>5)) | |{{#{{}}}}
Simple 10-dot Version
{{Dot|7}}
{{#iferror:{{#expr:1*7}}|7|{{#ifexpr:{{#if:|1|0}} and ((7>5) or (10>5)) | |{{#if:|{{#}}}}
Spaced 10-dot Version
{{Dot|7|separator=1}}
{{#iferror:{{#expr:1*7}}|7|{{#ifexpr:{{#if:1|1|0}} and ((7>5) or (10>5)) | |{{#if:|{{#}}}}
Simple 10-box Version
{{Dot|7|boxes=1}}
{{#iferror:{{#expr:1*7}}|7|{{#ifexpr:{{#if:|1|0}} and ((7>5) or (10>5)) | |{{#if:1{{#}}}}
No Trailing Hollow Characters
{{Dot|3|0}} (preferred) or {{Dot|3|5|hollowchar=}}
{{#iferror:{{#expr:1*3}}|3|{{#ifexpr:{{#if:|1|0}} and ((3>5) or (0>5)) | |{{#}}}}
{{#iferror:{{#expr:1*3}}|3|{{#ifexpr:{{#if:|1|0}} and ((3>5) or (5>5)) | |{{#}}}}
Please note that the first style is much easier for the wiki to produce, especially when producing 5 dots or less, and is therefore the preferred method. The second method will also work, however, and may be preferable in some situations such as a template that needs to be flexible about what parameters it's passing.
Full Parameter List
{{Dot |number of filled dots (defaults to 0) |number of total dots (defaults to 10) |separator=specify any value to include a separator (defaults to no separator) |fontsize=changes size of dots using CSS standards such as 12pt, small, or 150% (defaults to CSS "larger") |boxes=specify any value to use boxes instead of dots (defaults to dots) |fillchar=character to use as a filled dot (must be a single character with no formatting, overrides boxes setting) (defaults to ●) |hollowchar=character to use as a hollow dot (must be a single character with no formatting, overrides boxes setting) (defaults to ○) }} ;Example{{Dot|3|10|fontsize=20pt|separator=1|fillchar=x|hollowchar=o}}{{#iferror:{{#expr:1*3}}|3|{{#ifexpr:{{#if:1|1|0}} and ((3>5) or (10>5)) | |xxxooooooo}}}}