Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Module:MilLeadership/doc

From Wikipedia, the free encyclopedia

This module builds a unit leadership table (commanding officers, RSMs, chaplains, and similar posts) from a list of people and from/to dates. Award codes are looked up in Module:MilAward (post-nominals and optional ribbon stacks). Dates are display strings; they are not passed through {{date}}.

Do not invoke this module from articles except through the templates below (or their /sandbox pages).

Templates that call this module

[edit]
TemplateInvokeWhat it does
{{MilLeadership}}{{#invoke:MilLeadership|table}}Renders the whole wikitable: caption, post headings, rows, optional ribbon column.
{{MilLeadership/sandbox}}sameSandbox copy of the table wrapper.
{{MilLdr}}{{#invoke:MilLeadership|line}}Serialises one person to an internal list line (from // to // rank // name // key=value). Does not draw a table by itself.
{{MilLdr/sandbox}}sameSandbox copy of the row helper.

User:BoonDock/MilLeadership and User:BoonDock/MilLdr redirect to the live templates. Module:Sandbox/BoonDock/MilLeadership forwards with require('Module:MilLeadership').

Why two templates

[edit]

A raw pipe (|) inside {{MilLeadership}} is a new template parameter, so this cannot work:

* 1978 | 1978 | Cmdt | [[Frank Bestbier]]

{{MilLdr}} keeps those pipes on the row template. It calls p.line, which returns a line using the delimiter // (space-slash-slash-space). p.table then parses those lines. http:// in URLs is not split, because that form has no spaces around //.

How it fits together

[edit]
Article
  {{MilLeadership | caption=... | ribbons=yes | content= == Post == {{MilLdr|...}} }}
        │
        ▼
  Module:MilLeadership.table   →  HTML wikitable
        │
        ├── {{MilAward PostNom}}   for awards=SD, SM, MMM
        └── {{MilAward Stack}}     ribbon column when |ribbons=yes (default size x8px)

Incumbent lists stay on the article. This module does not store COs in a data module. Medal data lives in Module:MilAward/data.

Entry points

[edit]
FunctionCalled fromRole
p.table / p.main{{MilLeadership}}Read template arguments and render the table.
p.line{{MilLdr}}Turn from/to/rank/name (and named extras) into one list line.
p._tableother LuaSame renderer, from a Lua args table (optional src for argument order).
p._parseLineconsole / testsParse one member line into a row table.

{{MilLeadership}} arguments

[edit]

Passed through to p.table:

ParameterDescription
|caption=Table caption
|float=right or left. Default: no float. Empty {{{1}}} is the same as omitting it.
|color= / |colour=Header and border colour. Default #CF9C65
|country=Reserved (ZAR). Award lookup uses MilAward codes, which are global.
|ribbons=yes to add a right-hand Ribbon column. Default off.
|ribbon_size=File height for that column. Default x8px. Aliases: |ribbon-size=, |ribbonsize=, |size=
|class=Extra CSS class on the table
|nocat=yes suppresses tracking categories
|content= / |posts=Member lists grouped by == Post name == headings. Preferred when there is more than one post, so order is preserved.
|title1= + |list1=Numbered posts (|title2=/|list2=, …). Aliases: |post1=, |members1=
any other named parameterTreated as a post heading; the value is that post’s member list. Do not rely on this for several posts: Lua 5.1 may not keep parameter order.

Example

[edit]
Example
FromCommanding OfficersTo
1978Cmdt Frank Bestbier [a]1978
Jan 1981Cmdt Roland de Vries SD,SM,MMM [b]1982
FromChaplainsTo
1983No permanent Appointment1983
{{MilLeadership
| caption = Example
| content =
== Commanding Officers ==
{{MilLdr|1978|1978|Cmdt|[[Frank Bestbier]]|note=Veggroup Juliet}}
{{MilLdr|Jan 1981|1982|Cmdt|[[Roland de Vries]]|awards=SD, SM, MMM|note=Later Major General}}
== Chaplains ==
{{MilLdr|1983|1983||''No permanent Appointment''}}
}}

With ribbons:

{{MilLeadership
| caption = Example
| ribbons = yes
| content =
== Commanding Officers ==
{{MilLdr|Jan 1981|1982|Cmdt|[[Roland de Vries]]|awards=SD, SM, MMM}}
}}

{{MilLdr}} arguments

[edit]

Passed through to p.line:

FieldDescription
|1= / |from=From date (display string: 1978, Nov 1978)
|2= / |to=To date
|3= / |rank=Rank or style at the time of the posting (Cmdt, WO1, Ds, …). May be empty (vacancy).
|4= / |name=Name. Wikilink it yourself; this module will not invent links. Aliases: |incumbent=, |post-incumbent=
|awards=MilAward codes, comma-separated: SD, SM, MMM
|note=Explanatory footnote ({{efn}})
|note-name=Named efn (e.g. RIP). First row should also set |note= to define the text; later rows use |note-name= only. Alias: |notename=
|notes=Extra footnotes, separated by ;;
|ref=Citation, wrapped in <ref>...</ref> unless it already contains one
|link=If the name is not already a wikilink: yes wraps [[name]], or a page title wraps [[title\|name]]
|vacant=yes shows ''No permanent appointment'' when the name is empty

Compact year range (list form only): * 1978–1982 // Cmdt // [[Name]]

The article still needs {{notelist}} (and {{reflist}}) where footnotes and references are collected.

Dependencies

[edit]

Tracking categories

[edit]

On mainspace pages only, unless |nocat=yes:

See also

[edit]
  1. ↑ Veggroup Juliet
  2. ↑ Later Major General