Module:Based on/sandbox

From blackwiki
< Module:Based on
Revision as of 20:23, 21 January 2020 by blackwiki>Nardog
Jump to navigation Jump to search

Documentation for this module may be created at Module:Based on/sandbox/doc

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 = string.format('%s <span style="display:inline-block">by %s</span>',
			s, args[2])
	end
	return s
end

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

return p