Module:Compact list/doc

Usage

Lua code for inside of another template (e.g., an infobox). Creates a compact list out of a set of named arguments. For example, if the argument to this module is "foo", it searches for all arguments named "foo" followed by an optional underscore followed by one or more digits. It then assembles all of the named argument into a "pretty printed" list, in numerical order. If the list is short (<= 4 long), the module uses {{hlist}} to print in the "A·B·C·D" format. If it is long, it will use {{collapsible list}}. The threshold can be set with |_limit=.

Typical usage in a parent template, which gathers all arguments named "foo":

{{#invoke:Compact list|main|foo|_limit=4}}

Examples

Note: these examples have the named arguments passed to the module directly. In practice, these named arguments would be passed to the template that invokes the module.

{{#invoke:Compact list|main|ook|ook=A|spud=1234}} → A

{{#invoke:Compact list|main|ook|ook1=A|ook_2=B}}

  • A
  • B

{{#invoke:Compact list|main|ook|ook=A|ook1=B|ook2=C|ook3=D}}

  • A
  • B
  • C
  • D

{{#invoke:Compact list|main|ook|ook1=A|ook5=B|ook20=C|ook3000=D|ook342345=E|foofoofoo=234}}

List
  • A
  • B
  • C
  • D
  • E

{{#invoke:Compact list|main|ook|ook1=A|ook5=B|ook20=C|ook3000=D|ook342345=E|foofoofoo=234|_limit=5}}

  • A
  • B
  • C
  • D
  • E

{{#invoke:Compact list|main|ook|ook=A|ook1=B|ook2=C|ook3=D|ook4=E|ook5=F|ook6=G}}

List
  • A
  • B
  • C
  • D
  • E
  • F
  • G

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.