Template:Ability: Difference between revisions
Jump to navigation
Jump to search
(New demo template) |
HiddenDragon (talk | contribs) (Updated to match other inline templates) |
||
Line 1: | Line 1: | ||
<includeonly> | <includeonly>{{#switch: {{{1|}}} | ||
{{documentation|content= | | Strength | ||
| Dexterity | |||
| Constitution | |||
| Intelligence | |||
| Wisdom | |||
| Charisma = {{IconLink|{{{1}}} icon.png|{{{1}}}|{{{2|{{{1}}}}}}|size={{{w|25}}}|nowrap=y}} | |||
| #default = [[{{{1}}}|{{{2|{{{1}}}}}}]] | |||
}}</includeonly><noinclude>{{documentation|content= | |||
This template is used to visually represent the main 6 abilities. Do note that saving throws should instead use [[Template:Saving throw]], while ability checks should use [[Template:Ability Check]]. | This template is used to visually represent the main 6 abilities. Do note that saving throws should instead use [[Template:Saving throw]], while ability checks should use [[Template:Ability Check]]. | ||
== Examples == | == Examples == | ||
{{Template demo | {{Template demo | ||
| caption 1 = Basic usage | |||
| <nowiki>{{Ability|Strength}}</nowiki> | | <nowiki>{{Ability|Strength}}</nowiki> | ||
| <nowiki>{{Ability|Dexterity|15}}</nowiki> | | caption 2 = Adjusted icon size | ||
| <nowiki>{{Ability|Constitution| | | <nowiki>{{Ability|Dexterity|w=15}}</nowiki> | ||
| | | caption 3 = Link alias | ||
| <nowiki>{{Ability| | | <nowiki>{{Ability|Constitution|CON}}</nowiki> | ||
| caption 4 = Alias and adjusted size | |||
| <nowiki>{{Ability|Intelligence|INT|w=40}}</nowiki> | |||
}} | }} | ||
Line 17: | Line 26: | ||
<templatedata> | <templatedata> | ||
{ | { | ||
"description": "Insert a link to an ability score accompanied by the associated icon.", | |||
"format": "inline", | |||
"params": { | "params": { | ||
"1": { | "1": { | ||
"label": " | "label": "Ability name", | ||
"description": "The name of the | "description": "The name of the ability score.", | ||
"type": "string", | "type": "string", | ||
"suggestedvalues": [ | |||
"Strength", | |||
"Dexterity", | |||
"Constitution", | |||
"Intelligence", | |||
"Wisdom", | |||
"Charisma" | |||
], | |||
"required": true | "required": true | ||
}, | }, | ||
"2": { | "2": { | ||
"label": "Alias", | |||
"description": "A user-defined alias to be shown instead of the ability name.", | |||
"type": "string" | |||
}, | |||
"w": { | |||
"label": "Icon size", | "label": "Icon size", | ||
"description": "The pixel size of the accompanying icon.", | "description": "The pixel size of the accompanying icon.", | ||
Line 31: | Line 55: | ||
} | } | ||
} | } | ||
</templatedata>}}</noinclude> | </templatedata>}} | ||
[[Category:Templates]] | |||
[[Category:Link templates]] | |||
</noinclude> |
Revision as of 17:08, 29 July 2024
Template documentation
This template is used to visually represent the main 6 abilities. Do note that saving throws should instead use Template:Saving throw, while ability checks should use Template:Ability Check.
Examples
Example | Markup | Renders as |
---|---|---|
Basic usage | {{Ability|Strength}} | |
Adjusted icon size | {{Ability|Dexterity|w=15}} | |
Link alias | {{Ability|Constitution|CON}} | |
Alias and adjusted size | {{Ability|Intelligence|INT|w=40}} |
Template data
Insert a link to an ability score accompanied by the associated icon.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Ability name | 1 | The name of the ability score.
| String | required |
Alias | 2 | A user-defined alias to be shown instead of the ability name. | String | optional |
Icon size | w | The pixel size of the accompanying icon. | Number | optional |