Jump to content

Module:Based on/sandbox

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Nardog (talk | contribs) at 23:43, 3 January 2020 (Created page with 'local p = {} function p._main(args) local s = args[1] if args[3] then local h = mw.html.create('ul') for i, v in ipairs(args) do if i ~= 1 then h:t...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
local p = {}

function p._main(args)
	local s = args[1]
	if args[3] then
		local h = mw.html.create('ul')
		for i, v in ipairs(args) do
			if i ~= 1 then
				h:tag('li'):wikitext(v):done()
			end
		end
		h = mw.html.create('')
			:wikitext(s .. ' ')
			:tag('br')
				:done()
			:tag('span')
				:css('vertical-align', 'top')
				:wikitext('by ')
				:done()
			:tag('div')
				:addClass('plainlist')
				:css('display', 'inline-block')
				:node(h)
			:allDone()
		s = h
	elseif args[2] then
		s = s .. ' <br />by ' .. args[2]
	end
	return s
end

function p.main(frame)
	return p._main(frame:getParent().args)
end

return p