Module:CGTBox

De USAC-CGT
Aller à la navigation Aller à la recherche

La documentation pour ce module peut être créée à Module:CGTBox/doc

local p = {} --p stands for package

local title = mw.title.getCurrentTitle()
local contents = {} -- table for html element for the contents of the box

function p.hello( frame )
	contents[#contents + 1] = mw.html.create('span')
	  :wikitext("Hello, world 2!")
	  :done()
	
    return returnBox()
end

function returnBox()
	--box
	local box = mw.html.create('div')
	  :addClass('infobox3')
	
	--Title
	box:node(
		mw.html.create('h3')
		:wikitext(title)
		:done())

	--contents
	for i, v in ipairs(t) do
		box:node(v)
	end
	
	box:done()
	
	return box
end	  

return p