Module:Sandbox/BrandonXLF/3

This is an old revision of this page, as edited by BrandonXLF (talk | contribs) at 07:52, 9 April 2024. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

-- Sandbox, do not delete

local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local p = {}

function p.main(frame)
	local args = getArgs(frame)
	
	local container = mw.html.create('div')
		:addClass('historical-affiliation')
		:css('float', args.float or 'right')
		
	if args.width then
		container:css('width', args.width)
	end
	
	local titleId = math.random()

	container:tag('div')
		:attr('id', titleId)
		:addClass('historical-affiliation-title')
		:wikitext(args.title and args.title or 'Historical affiliations')
		
	local list = container:tag('ul')
		:attr('aria-labelledby', titleId)
		:addClass('historical-affiliation-list')

	for _, val in ipairs(args) do
		list:tag('li'):wikitext(val)
	end

	return tostring(container) .. frame:extensionTag{
		name = 'templatestyles',
		args = { src = 'User:BrandonXLF/J/styles.css' }
	}
end

return p