Module:Further

From Chalo Chatu, Zambia online encyclopedia
Revision as of 23:28, 2 July 2016 by Icem4k (talk | contribs) (Created page with "--[[ -- This module produces a "Further information: a, b and c" link. It implements -- the {{further}} template. --]] local mHatnote = require('Module:Hatnote') local mHatli...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

--[[ -- This module produces a "Further information: a, b and c" link. It implements -- the Error: no page names specified (help). template. --]]

local mHatnote = require('Module:Hatnote') local mHatlist = require('Module:Hatnote list') local mTableTools -- lazily initialise local mArguments -- lazily initialise local p = {}

function p.further(frame) mTableTools = require('Module:TableTools') mArguments = require('Module:Arguments') local args = mArguments.getArgs(frame, {parentOnly = true}) local pages = mTableTools.compressSparseArray(args) if #pages < 1 then return mHatnote.makeWikitextError( 'no page names specified', 'Template:Further#Errors', args.category ) end local options = { selfref = args.selfref } return p._further(pages, options) end

function p._further(pages, options) local text = 'Further information: ' .. mHatlist.andList(pages, true) return mHatnote._hatnote(text, options) end

return p