Template:Ca-nom
Appearance
Unchecked
Module:CaNom
-- Module:CaNom
local M = {}
local function trim(s) return (tostring(s or ""):gsub("^%s+",""):gsub("%s+$","")) end
local function split(list)
list = tostring(list or "")
list = list:gsub(";", ",")
local t = {}
for item in list:gmatch("([^,]+)") do
local it = trim(item)
if it ~= "" then table.insert(t, it) end
end
return t
end
function M.commaList(frame)
local list = frame.args.list or ""
local items = split(list)
return table.concat(items, ", ")
end
function M.commaLinks(frame)
local list = frame.args.list or ""
local items = split(list)
local out = {}
for _, it in ipairs(items) do
table.insert(out, "[[" .. it .. "]]")
end
return table.concat(out, ", ")
end
return M
Template documentation
[edit source]Template:Ca-nom renders a compact or full name information card for people, characters, or entities. It supports native-script names, transliteration, pronunciation, aliases, honorifics, and signature display while hiding empty fields automatically.
Purpose
[edit source]- Provide a consistent, concise presentation of name-related data in infoboxes or lead sections.
- Distinguish native names, transliterations, and pronunciation from aliases and variants.
- Offer optional categorization for maintenance.
Usage
[edit source]Basic:
{{Ca-nom
|name=Jane Doe
|honorific=Dr.
}}
With native name and transliteration:
{{Ca-nom
|name=Zhang Wei
|native=张伟
|lang=zh
|translit=Zhāng Wěi
|ipa=ʈʂáŋ wěɪ
}}
Aliases, abbreviations, signature:
{{Ca-nom
|name=John Fitzgerald Kennedy
|abbrev=JFK
|alias=Jack Kennedy;Senator Kennedy
|signature=File:John_F._Kennedy_Signature.svg
|signing=J. F. Kennedy
}}
Compact boxed display:
{{Ca-nom
|name=Mary Shelley
|penname=Mary W. Shelley
|box=yes
|compact=yes
}}
Parameters
[edit source]- name
- Primary display name (recommended).
- native
- Native-script name.
- lang
- Language code or label for the native name.
- alias
- Other names/aliases (comma or semicolon-separated; auto-linked).
- aka
- Free-form "also known as" text line.
- birthname
- Name at birth.
- honorific
- Titles/honorifics (Sir, Dr., etc.).
- penname
- Pen/stage name.
- abbrev
- Abbreviations or initials.
- variants
- Orthographic or letter variants.
- translit
- Transliteration of the native name.
- ipa
- Pronunciation (IPA).
- audio
- Audio file for pronunciation.
- signature
- Signature image file.
- signing
- Usual signing style string.
- source
- Citation/source of the name data.
- compact
yes/true/1for slightly smaller layout.- box
yes/true/1to add a soft box style.- nocat
- Suppress maintenance category emission.
- catprefix
- Override category prefix (default
Category:Name cards).
Categories
[edit source]- By default:
[[Category:Name cards]]
- Missing primary name:
[[Category:Name cards missing primary name]]
Adjust with catprefix to fit local conventions.
Best practices
[edit source]- Keep the header concise; move extended biographical details to infobox or prose.
- Use ISO language codes for
langwhere feasible. - Prefer IPA for pronunciation; include audio when available.
- Use
aliasfor alternate names that have standalone pages to link.