Template:AbilityTable/doc: Difference between revisionsGive feedback
Create /doc subpage with usage, parameters, see also, and live example (with help from vergir-bot LLM) |
Updated doc to add collapsed info and also added TemplateData |
||
| (3 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
Renders a sortable table of all abilities matching a named list, or a compact inline list. | |||
Renders a sortable table of all abilities | The table can optionally be made collapsible. | ||
== Usage == | == Usage == | ||
<pre>{{AbilityTable|charges}}</pre> | <pre>{{AbilityTable|charges}}</pre> | ||
Compact mode (renders as an inline list instead of a table): | |||
<pre>{{AbilityTable|charges|compact=1}}</pre> | |||
With a hidden column: | With a hidden column: | ||
| Line 11: | Line 14: | ||
Multiple columns can be hidden using a comma-separated list: | Multiple columns can be hidden using a comma-separated list: | ||
<pre>{{AbilityTable|charges|hide=Time Between Charges, Notes}}</pre> | <pre>{{AbilityTable|charges|hide=Time Between Charges, Notes}}</pre> | ||
Collapsible table, initially hidden: | |||
<pre>{{AbilityTable|charges|collapsed=yes}}</pre> | |||
Collapsible table, initially shown (toggleable via header): | |||
<pre>{{AbilityTable|charges|collapsed=no}}</pre> | |||
== Parameters == | == Parameters == | ||
; 1 : The | ; 1 : The list name. Must match a key in [[Module:AbilityTable/Lists]]. | ||
; hide : Optional. A | ; compact : Optional. When set to any non‑empty value (e.g. <code>compact=1</code>), renders a compact inline list instead of a full table. Abilities are grouped by hero with notes shown in parentheses. Collapsing does not apply in this mode. | ||
; hide : Optional. A comma‑separated list of column names to exclude from the table. Hero and Ability columns cannot be hidden. Has no effect in compact mode. | |||
; collapsed : Optional. Enables collapsible behaviour for the table. | |||
:* <code>collapsed=yes</code> (or <code>true</code>, <code>1</code>) – table starts hidden; click the header to expand. | |||
:* <code>collapsed=no</code> (or any other non‑empty value) – table shows a collapse toggle but starts fully expanded. | |||
: Omit the parameter entirely to render a static, non‑collapsible table (default behaviour). | |||
: Has no effect when <code>compact</code> is used. | |||
== | == Examples == | ||
The following renders a table of all abilities | The following renders a table of all abilities in the '''melee''' list: | ||
<pre>{{AbilityTable|melee}}</pre> | <pre>{{AbilityTable|melee}}</pre> | ||
{{AbilityTable|melee}} | {{AbilityTable|melee}} | ||
The same list in compact mode: | |||
<pre>{{AbilityTable|melee|compact=1}}</pre> | |||
{{AbilityTable|melee|compact=1}} | |||
A collapsible table that starts hidden (click the header to reveal): | |||
<pre>{{AbilityTable|melee|collapsed=yes}}</pre> | |||
{{AbilityTable|melee|collapsed=yes}} | |||
A collapsible table that starts open with a visible collapse button: | |||
<pre>{{AbilityTable|melee|collapsed=no}}</pre> | |||
{{AbilityTable|melee|collapsed=no}} | |||
== See also == | == See also == | ||
* [[Module:AbilityTable]] — backing Lua module | * [[Module:AbilityTable]] — backing Lua module | ||
* [[Module:AbilityTable/Lists]] — defines which properties each list matches on | |||
* [[Module:AbilityTable/Notes]] — editor‑authored notes for abilities | |||
* [[Template:AbilityTable/styles.css]] — stylesheet for this template | * [[Template:AbilityTable/styles.css]] — stylesheet for this template | ||
<templatedata> | |||
{ | |||
"description": "Renders a sortable table of abilities matching a named list, or a compact inline list. Optionally collapsible.", | |||
"params": { | |||
"1": { | |||
"label": "List name", | |||
"description": "Name of the ability list to display (must match a key in Module:AbilityTable/Lists).", | |||
"type": "string", | |||
"required": true, | |||
"example": "charges" | |||
}, | |||
"compact": { | |||
"label": "Compact mode", | |||
"description": "If set to any non‑empty value (e.g. 1), render a compact inline list instead of a table.", | |||
"type": "string", | |||
"required": false, | |||
"example": "1" | |||
}, | |||
"hide": { | |||
"label": "Hide columns", | |||
"description": "Comma‑separated column names to exclude from the table (e.g. \"Time Between Charges, Notes\"). Hero and Ability cannot be hidden. Ignored in compact mode.", | |||
"type": "string", | |||
"required": false | |||
}, | |||
"collapsed": { | |||
"label": "Collapse table", | |||
"description": "Makes the table collapsible. Use 'yes' to start hidden, 'no' to start expanded with a toggle. Omit for a static table.", | |||
"type": "string", | |||
"suggestedvalues": ["yes", "no"], | |||
"required": false | |||
} | |||
}, | |||
"format": "inline" | |||
} | |||
</templatedata> | |||
<includeonly>[[Category:Ability templates]]</includeonly> | <includeonly>[[Category:Ability templates]]</includeonly> | ||
Latest revision as of 15:05, 11 July 2026
Renders a sortable table of all abilities matching a named list, or a compact inline list. The table can optionally be made collapsible.
Usage
[edit source]{{AbilityTable|charges}}
Compact mode (renders as an inline list instead of a table):
{{AbilityTable|charges|compact=1}}
With a hidden column:
{{AbilityTable|charges|hide=Time Between Charges}}
Multiple columns can be hidden using a comma-separated list:
{{AbilityTable|charges|hide=Time Between Charges, Notes}}
Collapsible table, initially hidden:
{{AbilityTable|charges|collapsed=yes}}
Collapsible table, initially shown (toggleable via header):
{{AbilityTable|charges|collapsed=no}}
Parameters
[edit source]- 1
- The list name. Must match a key in Module:AbilityTable/Lists.
- compact
- Optional. When set to any non‑empty value (e.g.
compact=1), renders a compact inline list instead of a full table. Abilities are grouped by hero with notes shown in parentheses. Collapsing does not apply in this mode. - hide
- Optional. A comma‑separated list of column names to exclude from the table. Hero and Ability columns cannot be hidden. Has no effect in compact mode.
- collapsed
- Optional. Enables collapsible behaviour for the table.
collapsed=yes(ortrue,1) – table starts hidden; click the header to expand.collapsed=no(or any other non‑empty value) – table shows a collapse toggle but starts fully expanded.
- Omit the parameter entirely to render a static, non‑collapsible table (default behaviour).
- Has no effect when
compactis used.
Examples
[edit source]The following renders a table of all abilities in the melee list:
{{AbilityTable|melee}}
| Hero | Ability | Base Damage | Light Melee Scaling | Notes |
|---|---|---|---|---|
| Bebop | Exploding Uppercut | 0.01 | ×1 | — |
| Grapple Arm | 0 | ×0.7 | — | |
| Billy | Bashdown | 0 | ×0.9 | on T3 becomes ×0.5 Heavy Melee scaling. |
| Calico | Leaping Slash | 10 | ×0.8 | on T3 gets +60 base damage (total 70). |
| Drifter | Rend | 0 | ×1.2 | on T3 becomes ×0.55 Heavy Melee scaling. |
| Silver | Boot Kick | 0 | ×0.9 | — |
| Silver (Transformed) | Go For The Throat | 0 | ×1.5 | on T1 gets +30 base damage (total 30). |
| Mauling Leap | 0 | ×1.5 | — | |
| Viscous | Puddle Punch | 20 | ×0.6 | on T1 gets +20 base damage (total 40). on T3 becomes 40 base damage with ×0.6 Heavy Melee scaling. Can be parried. |
| Yamato | Flying Slash | 0 | ×1 | — |
The same list in compact mode:
{{AbilityTable|melee|compact=1}}
- Bebop: Exploding Uppercut, Grapple Arm
- Billy: Bashdown (on T3 becomes ×0.5 Heavy Melee scaling)
- Calico: Leaping Slash (on T3 gets +60 base damage (total 70))
- Drifter: Rend (on T3 becomes ×0.55 Heavy Melee scaling)
- Silver: Boot Kick
- Silver (Transformed): Go For The Throat (on T1 gets +30 base damage (total 30)), Mauling Leap
- Viscous: Puddle Punch (on T1 gets +20 base damage (total 40). on T3 becomes 40 base damage with ×0.6 Heavy Melee scaling; can be parried)
- Yamato: Flying Slash
A collapsible table that starts hidden (click the header to reveal):
{{AbilityTable|melee|collapsed=yes}}
| Hero | Ability | Base Damage | Light Melee Scaling | Notes |
|---|---|---|---|---|
| Bebop | Exploding Uppercut | 0.01 | ×1 | — |
| Grapple Arm | 0 | ×0.7 | — | |
| Billy | Bashdown | 0 | ×0.9 | on T3 becomes ×0.5 Heavy Melee scaling. |
| Calico | Leaping Slash | 10 | ×0.8 | on T3 gets +60 base damage (total 70). |
| Drifter | Rend | 0 | ×1.2 | on T3 becomes ×0.55 Heavy Melee scaling. |
| Silver | Boot Kick | 0 | ×0.9 | — |
| Silver (Transformed) | Go For The Throat | 0 | ×1.5 | on T1 gets +30 base damage (total 30). |
| Mauling Leap | 0 | ×1.5 | — | |
| Viscous | Puddle Punch | 20 | ×0.6 | on T1 gets +20 base damage (total 40). on T3 becomes 40 base damage with ×0.6 Heavy Melee scaling. Can be parried. |
| Yamato | Flying Slash | 0 | ×1 | — |
A collapsible table that starts open with a visible collapse button:
{{AbilityTable|melee|collapsed=no}}
| Hero | Ability | Base Damage | Light Melee Scaling | Notes |
|---|---|---|---|---|
| Bebop | Exploding Uppercut | 0.01 | ×1 | — |
| Grapple Arm | 0 | ×0.7 | — | |
| Billy | Bashdown | 0 | ×0.9 | on T3 becomes ×0.5 Heavy Melee scaling. |
| Calico | Leaping Slash | 10 | ×0.8 | on T3 gets +60 base damage (total 70). |
| Drifter | Rend | 0 | ×1.2 | on T3 becomes ×0.55 Heavy Melee scaling. |
| Silver | Boot Kick | 0 | ×0.9 | — |
| Silver (Transformed) | Go For The Throat | 0 | ×1.5 | on T1 gets +30 base damage (total 30). |
| Mauling Leap | 0 | ×1.5 | — | |
| Viscous | Puddle Punch | 20 | ×0.6 | on T1 gets +20 base damage (total 40). on T3 becomes 40 base damage with ×0.6 Heavy Melee scaling. Can be parried. |
| Yamato | Flying Slash | 0 | ×1 | — |
See also
[edit source]- Module:AbilityTable — backing Lua module
- Module:AbilityTable/Lists — defines which properties each list matches on
- Module:AbilityTable/Notes — editor‑authored notes for abilities
- Template:AbilityTable/styles.css — stylesheet for this template
Renders a sortable table of abilities matching a named list, or a compact inline list. Optionally collapsible.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| List name | 1 | Name of the ability list to display (must match a key in Module:AbilityTable/Lists).
| String | required |
| Compact mode | compact | If set to any non‑empty value (e.g. 1), render a compact inline list instead of a table.
| String | optional |
| Hide columns | hide | Comma‑separated column names to exclude from the table (e.g. "Time Between Charges, Notes"). Hero and Ability cannot be hidden. Ignored in compact mode. | String | optional |
| Collapse table | collapsed | Makes the table collapsible. Use 'yes' to start hidden, 'no' to start expanded with a toggle. Omit for a static table.
| String | optional |