Anonymous user
Module:See also: Difference between revisions
Updated from sandbox; in particular, applies use of Module:Hatnote list
m (1 revision imported: Templates) |
(Updated from sandbox; in particular, applies use of Module:Hatnote list) |
||
Line 1:
--[[
-- This module produces a "See also: a, b, and c" link. It implements the
-- template {{see also}}.
--]]
local mHatnote = require('Module:Hatnote')
local mArguments -- lazily initialise
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
function p.
▲ mTableTools = require('Module:TableTools')
mArguments = require('Module:Arguments')
local args = mArguments.getArgs(frame, {parentOnly = true})
Line 17:
for k, v in pairs(args) do
if type(k) == 'number' then
local
local
string.format('%s|%s', string.gsub(v, '|.*$', ''), display) or v
▲ pages[k] = page
end
end
if not pages[1] then
return mHatnote.makeWikitextError(
Line 36 ⟶ 34:
selfref = args.selfref
}
return p._seealso(
end
function p.
checkType('_seeAlso', 1, args, 'table')
checkType('_seeAlso', 2, options, 'table', true)
options = options or {}
local
local list = mHatlist.andList(args, true)
local text = phrase .. ': ' .. list
-- Pass options through.
local hnOptions = {selfref = options.selfref}
return mHatnote._hatnote(text, hnOptions)
end
--temporary aliases to move to CamelCase
p.seealso = p.seeAlso
p._seealso = p._seeAlso
return p
|