Difference between revisions of "Template:Colorbull/doc"

From blackwiki
Jump to navigation Jump to search
imported>GKFX
m (Delete duplicated content)
imported>Vanisaac
m (→‎See also: clean up per WP:CAT#T and WP:AWBREQ add template:Sandbox other)
 
(15 intermediate revisions by 4 users not shown)
Line 2: Line 2:
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
  
{{Format TemplateData|TOC=1|JSON=
+
This template inserts a colored bullet, with an optional [[wikilink]]. The bullet’s shape and size can also be changed.
 +
 
 +
== Usage ==
 +
<code>&#123;&#123;colorbull{{!}}{{var|color}}{{!}}{{var|shape}}{{!}}{{var|wikilink}}{{!}}{{var|size<nowiki>=</nowiki>}}{{!}}{{var|description<nowiki>=</nowiki>}}}}</code>
 +
 
 +
*{{var|Colors}} are most commonly specified as either a color keyword or as the hexadecimal triplet representing an RGB combination.  See [[web colors]] for details. The default is black.
 +
*{{var|Shape}} is optional; valid arguments are:
 +
::{|class="wikitable"
 +
|-
 +
| c / circle / r / round || ●
 +
|-
 +
| d / diamond || ◆
 +
|-
 +
| tu / up / uptriangle || ▲
 +
|-
 +
| td / dn / downtriangle || ▼
 +
|-
 +
| tl / lt / lefttriangle || ◀
 +
|-
 +
| tr / rt / righttriangle || ▶
 +
|-
 +
| {{var|default}} || ■
 +
|}
 +
* The {{var|wikilink}} parameter is also optional and specifies the article to which the text should point.
 +
* The named parameter {{var|size}} is a number specifying the bullet size as a % of the default style text size. Default is 100.
 +
* The named parameter {{var|description}} replaces the default <code>{{var|color}}</code> tooltip. This is also heard by a screen reader.
 +
 
 +
=== Examples ===
 +
{| class="wikitable"
 +
|-
 +
! Visual<br/>effect !! Markup
 +
|-
 +
| {{colorbull}} || <code><nowiki>{{colorbull}}</nowiki></code>
 +
|-
 +
| {{colorbull|#039}} || <code><nowiki>{{colorbull|#039}}</nowiki></code>
 +
|-
 +
| {{colorbull|size=50}} || <code><nowiki>{{colorbull|size=50}}</nowiki></code>
 +
|-
 +
| {{colorbull|red|round}} || <code><nowiki>{{colorbull|red|round}}</nowiki></code>
 +
|-
 +
| {{colorbull|green|d}} || <code><nowiki>{{colorbull|green|d}}</nowiki></code>
 +
|-
 +
| {{colorbull||tu|triangle}} || <code><nowiki>{{colorbull||tu|triangle}}</nowiki></code>
 +
|}
 +
 
 +
== See also ==
 +
{{Color box templates}}
 +
*{{tl|*}} / {{tl|bull}} / {{tl|bullet}}, a simple bullet. (e.g. {{*}})
 +
 
 +
 
 +
{{Format TemplateData|TOC=0|JSON=
 
{
 
{
 
"params": {
 
"params": {
Line 8: Line 58:
 
"label": "Color",
 
"label": "Color",
 
"description": "Most commonly specified as either a color keyword or as the hexadecimal triplet representing an RGB combination.  See the article [[web colors]] for details.",
 
"description": "Most commonly specified as either a color keyword or as the hexadecimal triplet representing an RGB combination.  See the article [[web colors]] for details.",
"example": "red",
+
"example": "#f00",
 
"type": "string",
 
"type": "string",
"default": "Black (or standard link color for links)",
+
"default": "black (or standard link color for links)",
 
"suggested": true
 
"suggested": true
 
},
 
},
 
"2": {
 
"2": {
 
"label": "Shape",
 
"label": "Shape",
"description": "One of: <noexport><table class=\"wikitable\"><tr>
+
"description": "“c” or “circle” or “r” or “round” gives ●; “d” or “diamond” gives ◆; “tu” or “up” or “uptriangle” gives ▲; “td” or “dn” or “downtriangle” gives ▼; “tl” or “lt” or “lefttriangle” gives ◀; “tr” or “rt” or “righttriangle” gives ▶; default is ■",
<td>c / circle / r / round</td>
 
<td>●</td></tr>
 
<tr>
 
<td>d / diamond</td>
 
<td>◆</td></tr>
 
<tr>
 
<td>tu / up / uptriangle</td>
 
<td>▲</td></tr>
 
<tr>
 
<td>td / dn / downtriangle</td>
 
<td>▼</td></tr>
 
<tr>
 
<td>tl / lt / lefttriangle</td>
 
<td>◀</td></tr>
 
<tr>
 
<td>tr / rt / righttriangle</td>
 
<td>▶</td></tr>
 
<tr>
 
<td><i>default</i></td>
 
<td>■</td>
 
</tr></table><i>Or for VisualEditor readers:</i><br></noexport>c / circle / r / round gives ●; d / diamond gives ◆; tu / up / uptriangle gives ▲; td / dn / downtriangle gives ▼; tl / lt / lefttriangle gives ◀; tr / rt / righttriangle gives ▶; default is ■",
 
 
"type": "string",
 
"type": "string",
 
"suggested": true,
 
"suggested": true,
Line 45: Line 74:
 
"description": "Optionally, a page name to link to.",
 
"description": "Optionally, a page name to link to.",
 
"type": "wiki-page-name",
 
"type": "wiki-page-name",
"suggested": true
+
"required": false
 
},
 
},
 
"size": {
 
"size": {
Line 53: Line 82:
 
"type": "number",
 
"type": "number",
 
"default": "The same size as surrounding text (100)",
 
"default": "The same size as surrounding text (100)",
"suggested": true
+
"required": false
 +
},
 +
"description": {
 +
"label": "Description",
 +
"description": "When hovered over, this is also heard by a screen reader. This optional parameter can be used to change the default to something more user-friendly.",
 +
"example": "dark blue",
 +
"type": "string",
 +
"default": "the value used for color as a tooltip",
 +
"required": false
 
}
 
}
 
},
 
},
Line 60: Line 97:
 
"2",
 
"2",
 
"3",
 
"3",
"size"
+
"size",
 +
                "description"
 
],
 
],
"description": "This template inserts a colored bullet, with an optional [[wikilink]]. The bullet’s shape and size can also be changed.<noexport><br><code>&#123;&#123;colorbull{{!}}<i>colour</i>{{!}}<i>shape</i>{{!}}<i>wikilink</i>{{!}}<i>size</i>{{=}}&#125;&#125;</code></noexport>",
+
"description": " ",
 
"format": "inline"
 
"format": "inline"
 
} }}
 
} }}
  
=== Examples ===
+
<includeonly>{{Sandbox other||
{| class="wikitable"
 
|-
 
! Visual<br/>effect !! Markup
 
|-
 
| {{colorbull}} || <code><nowiki>{{colorbull}}</nowiki></code>
 
|-
 
| {{colorbull|#039}} || <code><nowiki>{{colorbull|#039}}</nowiki></code>
 
|-
 
| {{colorbull|size=50}} || <code><nowiki>{{colorbull|size=50}}</nowiki></code>
 
|-
 
| {{colorbull|red|round}} || <code><nowiki>{{colorbull|red|round}}</nowiki></code>
 
|-
 
| {{colorbull|green|d}} || <code><nowiki>{{colorbull|green|d}}</nowiki></code>
 
|-
 
| {{colorbull||tu|triangle}} || <code><nowiki>{{colorbull||tu|triangle}}</nowiki></code>
 
|}
 
 
 
== See also ==
 
{{Color box templates}}
 
*{{tl|*}}/{{tl|bull}}/{{tl|bullet}}, a simple bullet. (e.g. {{*}})
 
 
 
 
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
 
 
<!-- Categories below this line, please; interwikis at Wikidata -->
 
<!-- Categories below this line, please; interwikis at Wikidata -->
 
[[Category:Color templates]]
 
[[Category:Color templates]]
  
 
}}</includeonly>
 
}}</includeonly>

Latest revision as of 15:39, 24 April 2020

This template inserts a colored bullet, with an optional wikilink. The bullet’s shape and size can also be changed.

Usage

{{colorbull|color|shape|wikilink|size=|description=}}

  • Colors are most commonly specified as either a color keyword or as the hexadecimal triplet representing an RGB combination. See web colors for details. The default is black.
  • Shape is optional; valid arguments are:
c / circle / r / round
d / diamond
tu / up / uptriangle
td / dn / downtriangle
tl / lt / lefttriangle
tr / rt / righttriangle
default
  • The wikilink parameter is also optional and specifies the article to which the text should point.
  • The named parameter size is a number specifying the bullet size as a % of the default style text size. Default is 100.
  • The named parameter description replaces the default color tooltip. This is also heard by a screen reader.

Examples

Visual
effect
Markup
{{colorbull}}
{{colorbull|#039}}
{{colorbull|size=50}}
{{colorbull|red|round}}
{{colorbull|green|d}}
{{colorbull||tu|triangle}}

See also

Template Description Example
{{Color box}} a small color box with black borders and text color   or  ORANGE 
{{Color box striped}} a striped version     
{{RouteBox}} a borderless version with text color and wikilinks Template:RouteBox
{{Colorbull}} a colored bullet with wikilinks
{{Legend2}} another borderless version   
{{Color sample}} a small color box with black borders
{{Swatch inline}} Template:Swatch inline
{{Background color}} orange
{{Rail color box}} a version with more display options
(part of Module:Adjacent stations)
Template:Rcb, Template:Rcb, etc.
{{Diagonal split color box}} a small color box split diagonally
   
   
, etc.
{{Motor type}} A small color box corresponding to the motor type Template:Motor type, etc.
  1. REDIRECT Template:•)


This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for Colorbull

ParameterDescriptionTypeStatus
Color1
Most commonly specified as either a color keyword or as the hexadecimal triplet representing an RGB combination. See the article web colors for details.
Default
black (or standard link color for links)
Example
#f00
Stringsuggested
Shape2
“c” or “circle” or “r” or “round” gives ●; “d” or “diamond” gives ◆; “tu” or “up” or “uptriangle” gives ▲; “td” or “dn” or “downtriangle” gives ▼; “tl” or “lt” or “lefttriangle” gives ◀; “tr” or “rt” or “righttriangle” gives ▶; default is ■
Default
Stringsuggested
Link target3
Optionally, a page name to link to.
Pageoptional
Sizesize
The size of the bullet relative to surrounding text, as a percentage. Omit the % sign.
Default
The same size as surrounding text (100)
Example
80
Numberoptional
Descriptiondescription
When hovered over, this is also heard by a screen reader. This optional parameter can be used to change the default to something more user-friendly.
Default
the value used for color as a tooltip
Example
dark blue
Stringoptional

Format: inline