Module:Infobox: Difference between revisions

From Guinea Isles Wiki
No edit summary
Tag: Manual revert
No edit summary
Line 6: Line 6:
local p = {}
local p = {}


-- Helper functions
function boolToYesNo(val)
if val then
return "Yes"
else
return "No"
end
end
-- Infobox class
function p.main(frame)
function p.main(frame)
local args = frame:getParent().args
local args = frame:getParent().args

Revision as of 07:36, 19 September 2025

Documentation for this module may be created at Module:Infobox/doc

--------------------------
-- Module for generic Infobox parent
------------------------
local capiunto = require 'capiunto'

local p = {}

-- Helper functions
function boolToYesNo(val)
	if val then
		return "Yes"
	else
		return "No"
	end
end

-- Infobox class
function p.main(frame)
	local args = frame:getParent().args
	local headerStyle
	if args.headerstyle and args.headerstyle ~= '' then
		headerStyle = string.format('background-color:%s;', args.headerstyle)
	else
		headerStyle = 'background-color:grey;'
	end
	local retval = capiunto.create( {
		title = args.title,
		headerStyle = headerStyle, 
	} )
	return retval
end

return p