Toggle menu
15
237
93
27.9K
Kenshi Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Enumerate/doc: Difference between revisions

From Kenshi Wiki
Prd (talk | contribs)
Created page with "{{documentation subpage}} {{Module rating|beta}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) --> == Usage == This module is meant to be invoked inside of a template, since it requires the argument list of the calling template. This module allows the enumeration of a set of parameters with a given prefix. If the prefix was <code>notes</code>, the parameters <code>notes1</code>, <code>note..."
 
Prd (talk | contribs)
No edit summary
Line 1: Line 1:
{{documentation subpage}}
{{documentation subpage}}
{{Module rating|beta}}
<!-- 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]]) -->
== Usage ==
== Usage ==
Line 78: Line 77:
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line, please; interwikis at Wikidata -->
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Modules]]
[[Category:Template metamodules]]
[[Category:Template metamodules]]
}}</includeonly><noinclude>
}}</includeonly><noinclude>
[[Category:Module documentation pages]]
[[Category:Module documentation pages]]
</noinclude>
</noinclude>

Revision as of 05:54, 2 March 2025

Usage

This module is meant to be invoked inside of a template, since it requires the argument list of the calling template.

This module allows the enumeration of a set of parameters with a given prefix. If the prefix was notes, the parameters notes1, notes2, notes3, and so on will be enumerated in a unordered list until it sees the first null parameter.

The prefix is defined by the first argument passed into the invocation.

Template:X35
{{#invoke:Enumerate|main|notes}}
Any page
{{X35
| notes1 = Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
| notes2 = Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
| notes3 = Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
| notes4 = Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
}}
Output
  • Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
  • Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
  • Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
  • Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

The entries will cut off in the event that the parameters are out of order.

Template:X35
{{#invoke:Enumerate|main|notes}}
Any page
{{X35
| notes1 = Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
| notes2 = Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
| notes3 = 
| notes4 = Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
}}
Output
  • Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
  • Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Do note that {{X35}} is sandbox template and does not actually call this module.

Parameters

  • |1= (or |prefix=) - The parameter prefix to enumerate over. Can be left blank.
  • |2= (or |suffix=) - The parameter suffix to enumerate over. Can be left blank.
  • |ordered=yes - Set to a yes, true, etc. to output a ordered list (<ol>) rather than a unorder list (<ul>)
  • |pre= - Text to prefix each list item with.
  • |post= - Text to suffix each list item with.

Examples uses

See also