Jump to content

Module:Main list

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Codename Lisa (talk | contribs) at 22:07, 6 February 2016 (Undid revision 703665856 by Codename Lisa (talk)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

--[[
-- This module produces a "For more details on this topic" link. It implements
-- the {{Main list}} template.
--]]

local mHatnote = require('Module:Hatnote')
local mArguments -- lazily initialise

local p = {}

function p.mainList(frame)
	mArguments = require('Module:Arguments')
	local args = mArguments.getArgs(frame, {parentOnly = true})
	local page = args[1]
	if not page then
		return mHatnote.makeWikitextError(
			'no page name specified',
			'Template:Main list#Errors',
			args.category
		)
	end
	return p._mainList(page)
end

function p._mainList(page)
	page = mHatnote._formatLink(page)
	local text = string.format('For a more comprehensive list, see %s.', page)
	return mHatnote._hatnote(text)
end

return p