Différences entre versions de « Module:Carrousel »
		
		
		
		
		
		Sauter à la navigation
		Sauter à la recherche
		
				
		
		
	
| Ligne 12 : | Ligne 12 : | ||
| local p = {} | local p = {} | ||
| function p.hello(frame) | function p.hello(frame) | ||
| − | + | 	local newline = [[ | |
| − | 	return '{| class="wikitable" align="right"   | + | |
| + | ]] | ||
| + | 	return '{| class="wikitable" align="right"'..newline | ||
| + |            .. '|- '..newline | ||
| + |            .. '| style="width:150px;text-align:left;"|  [['.. frame.args[1] .. '|< '.. frame.args[1] .. ']] '..newline | ||
| + |            .. '| style="width:150px;text-align:right;"| [[' .. frame.args[2] ..'|' .. frame.args[2] ..' > ]]'..newline | ||
| + |            .. '|}' | ||
| end | end | ||
| return p | return p | ||
Version du 27 octobre 2021 à 13:47
La documentation pour ce module peut être créée à Module:Carrousel/doc
--[[
-- Debug console
frame = mw.getCurrentFrame() -- Get a frame object
newFrame = frame:newChild{ -- Get one with args
 args = { 'Adrien IV',  'Pie  VII' }
}
mw.log(p.hello( newFrame ) )
]]
local p = {}
function p.hello(frame)
	local newline = [[
]]
	return '{| class="wikitable" align="right"'..newline
           .. '|- '..newline
           .. '| style="width:150px;text-align:left;"|  [['.. frame.args[1] .. '|< '.. frame.args[1] .. ']] '..newline
           .. '| style="width:150px;text-align:right;"| [[' .. frame.args[2] ..'|' .. frame.args[2] ..' > ]]'..newline
           .. '|}'
 
end
return p