Module:qualifier: difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
Surjection (talk | contribs) No edit summary |
allow customization or open/close params |
||
Line 1: | Line 1: | ||
local export = {} |
local export = {} |
||
function export.format_qualifier(list) -- keep in sync with [[Template:qualifier]] |
function export.format_qualifier(list, open, close) -- keep in sync with [[Template:qualifier]] |
||
if type(list) ~= "table" then |
if type(list) ~= "table" then |
||
list = { list } |
list = { list } |
||
Line 10: | Line 10: | ||
end |
end |
||
return '<span class="ib-brac qualifier-brac">(</span>' .. |
return '<span class="ib-brac qualifier-brac">' .. (open or "(") .. '</span>' .. |
||
'<span class="ib-content qualifier-content">' .. |
'<span class="ib-content qualifier-content">' .. |
||
table.concat(list, '<span class="ib-comma qualifier-comma">,</span> ') .. |
table.concat(list, '<span class="ib-comma qualifier-comma">,</span> ') .. |
||
'</span><span class="ib-brac qualifier-brac">)</span>' |
'</span><span class="ib-brac qualifier-brac">' .. (close or ")") .. '</span>' |
||
end |
end |
||
Revision as of 03:39, 30 October 2022
- The following documentation is located at Module:qualifier/documentation. [edit]
- Useful links: subpage list • links • transclusions • testcases • sandbox
A module for formatting lists of qualifiers ({{qualifier}}
, {{sense}}
, {{antsense}}
).
local export = {}
function export.format_qualifier(list, open, close) -- keep in sync with [[Template:qualifier]]
if type(list) ~= "table" then
list = { list }
end
if #list == 0 then
return ''
end
return '<span class="ib-brac qualifier-brac">' .. (open or "(") .. '</span>' ..
'<span class="ib-content qualifier-content">' ..
table.concat(list, '<span class="ib-comma qualifier-comma">,</span> ') ..
'</span><span class="ib-brac qualifier-brac">' .. (close or ")") .. '</span>'
end
function export.sense(list) -- keep in sync with [[Template:sense]]
return export.format_qualifier(list)
.. '<span class="ib-colon sense-qualifier-colon">:</span>'
end
return export