Module:Params/doc/examples/informal tablebox: Difference between revisions
From Kenshi Wiki
More actions
No edit summary |
No edit summary |
||
| Line 2: | Line 2: | ||
|<caption>{{{caption}}}</caption> | |<caption>{{{caption}}}</caption> | ||
}}|</table>|{{Error|Error: Table is empty.}}|mapping_by_replacing|^[^;:][^:]*$|<tr><th>%0</th><td>{{{implicitly|✔}}}</td></tr>|1|mapping_by_replacing|^([^;:].-)%s*:%s*(.*)$|<tr><th>%1</th><td>%2</td></tr>|1|mapping_by_replacing|^;%s*(.*)$|<tr><th colspan{{safesubst:<noinclude />=}}"2">%1</th></tr>|1|mapping_by_replacing|^:%s*(.*)$|<tr><td colspan{{safesubst:<noinclude />=}}"2">%1</td></tr>|1|list_values}}</includeonly><noinclude>{{Documentation|heading=[[File:Test Template Info-Icon - Version (2).svg|50px|alt=|link=]] Template documentation}} | }}|</table>|{{Error|Error: Table is empty.}}|mapping_by_replacing|^[^;:][^:]*$|<tr><th>%0</th><td>{{{implicitly|✔}}}</td></tr>|1|mapping_by_replacing|^([^;:].-)%s*:%s*(.*)$|<tr><th>%1</th><td>%2</td></tr>|1|mapping_by_replacing|^;%s*(.*)$|<tr><th colspan{{safesubst:<noinclude />=}}"2">%1</th></tr>|1|mapping_by_replacing|^:%s*(.*)$|<tr><td colspan{{safesubst:<noinclude />=}}"2">%1</td></tr>|1|list_values}}</includeonly><noinclude>{{Documentation|heading=[[File:Test Template Info-Icon - Version (2).svg|50px|alt=|link=]] Template documentation}} | ||
[[Category:Module | [[Category:Module data pages]] | ||
</noinclude> | </noinclude> | ||
Latest revision as of 23:57, 14 March 2025
| This module uses TemplateStyles: |
| Uses Lua: |
This example template shows how to use {{#invoke:params|call_for_each_group}} to create an informal (unstructured) infobox-like template to be inserted directly in Wikipedia article.
- For a meta-template for creating structured infoboxes, see {{module:params/doc/examples/tablebox}}.
Usage
For instance, writing
{{module:params/doc/examples/informal tablebox | caption = Electron
| ; General properties
| Family: [[Lepton]]
| [[Particle|Composition]]: [[Elementary particle]]
| ; Physical properties
| [[Mass]]: {{val|510.99895069|(16)|u=[[Electronvolt|keV]] [[Speed of light|c]]<sup>−2</sup>}}<br /><small>({{val|9.1093837139|(28)|e=-31|u=[[kilogram|kg]]}})</small>
| [[Electric charge]]: {{val|-1.602176634|e=-19|u=[[coulomb (unit)|C]]}}
| [[Color charge]]: ―
| [[Spin (physics)|Spin]]: {{frac|1|2}}
| [[Half-life|Stable]]
| ; Lorem ipsum
| : Dolor sit amet
}}will generate
| General properties | |
|---|---|
| Family | Lepton |
| Composition | Elementary particle |
| Physical properties | |
| Mass | 510.99895069(16) keV c−2 (9.1093837139(28)×10−31 kg) |
| Electric charge | −1.602176634×10−19 C |
| Color charge | ― |
| Spin | 1⁄2 |
| Stable | ✔ |
| Lorem ipsum | |
| Dolor sit amet | |