Module:Sheet

From Baldur's Gate 3 Wiki
Revision as of 21:01, 31 December 2023 by Willowisp (talk | contribs) (Created page with "local p = {} local function _infobox() root = mw.html.create() root :wikitext(args.title) end local function renderStrRow() if not args.str then return end has_rows = true has_list_class({ args.belowclass }) root :tag('tr') :tag('td') :attr('colspan', '1') :addClass('infobox-ability') :addClass(args.abilityclass) :cssText(args.belowstyle) :wikitext(fixChildBoxes(args.str,'td')) end function p.infobox(frame) if frame == mw.getC...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This Module page is licensed under CC BY-SA 4.0. See Wikipedia for the original.

local p = {}

local function _infobox()
		root = mw.html.create()

		root
			:wikitext(args.title)
end
	
local function renderStrRow()
	if not args.str then return end

	has_rows = true
	has_list_class({ args.belowclass })
	
	root
		:tag('tr')
			:tag('td')
				:attr('colspan', '1')
				:addClass('infobox-ability')
				:addClass(args.abilityclass)
				:cssText(args.belowstyle)
				:wikitext(fixChildBoxes(args.str,'td'))
end

function p.infobox(frame)
	if frame == mw.getCurrentFrame() then
		origArgs = frame:getParent().args
	else
		origArgs = frame
	end
	
	parseDataParameters()
	
	return _infobox()
end

function p.infoboxTemplate(frame)
	origArgs = {}
	for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end
	
	parseDataParameters()
	
	return _infobox()
end
return p