Module:Hatnote: Difference between revisions
Jump to navigation
Jump to search
add Template:Further
>Mr. Stradivarius (add Template:Details) |
>Mr. Stradivarius (add Template:Further) |
||
Line 151: | Line 151: | ||
p.details = makeInvokeFunction(f.details) | p.details = makeInvokeFunction(f.details) | ||
-------------------------------------------------------------------------------- | |||
-- Further | |||
-- | |||
-- Produces a "Further information: a, b and c" link. It accepts an unlimited | |||
-- number of positional parameters, each of which is a page name. | |||
-------------------------------------------------------------------------------- | |||
function p._further(...) | |||
local pages = {...} | |||
local formattedPages = {} | |||
for i, page in ipairs(pages) do | |||
formattedPages[i] = formatLink(page) | |||
end | |||
local text = 'Further information: ' .. mw.text.listToText(formattedPages) | |||
return p._rellink(text) | |||
end | |||
function f.further(args) | |||
local pages = mTableTools.compressSparseArray(args) | |||
if #pages < 1 then | |||
return makeWikiTextError('no pages specified') | |||
end | |||
return p._further(unpack(pages)) | |||
end | |||
p.further = makeInvokeFunction(f.further) | |||
return p | return p |