Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Main

From Official Streamlined Wiki
Module documentation[view][edit][history][purge]
This documentation is transcluded from Module:Main/doc. Changes can be proposed in the talk page.
Function list
L 7 — p.main
L 27 — p._main

Module that implements {{Main}}


local labelledListHatnote = require('Module:Labelled list hatnote')
local mArguments --initialize lazily
local yesno --initialize lazily
local p = {}

--Implements {{main}} from the frame
function p.main (frame)
	mArguments = require('Module:Arguments')
	yesno = require('Module:Yesno')
	local template = frame:getParent():getTitle()
	local args = mArguments.getArgs(frame, {parentOnly = true})
	local pages = labelledListHatnote.preprocessDisplays(args)

	local options = {
		category = yesno(args.category),
		extraclasses = frame.args.extraclasses,
		ifexists = yesno(frame.args.ifexists),
		namespace = frame.args.namespace or args.namespace,
		selfref = yesno(frame.args.selfref or args.selfref),
		template = template
	}

	return p._main(pages, options)
end

--Implements {{main}} but takes a manual arguments table
function p._main (pages, options)
	local labels = {
		'Main article',
		'Main articles',
		'Main page',
		'Main pages'
	}
	options.icon = "WikimediaUI-Article-ltr.svg"
	return labelledListHatnote._labelledList(pages, labels, options)
end

return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies.