[go: nahoru, domu]

לדלג לתוכן

יחידה:הצג מספר שורות1

מתוך ויקיפדיה, האנציקלופדיה החופשית

ניתן ליצור תיעוד על היחידה הזאת בדף יחידה:הצג מספר שורות1/תיעוד

local function lines(frame)
	local num = frame.args["מספר שורות"]+0
	local i = 1
	local j = 1
	local string = ""
    while (j <= num) and not (frame.args[i]==nil) do
   	   	if not (frame.args[i]=="") then
   	   	   string = string.format("%s\n%s",string,frame.args[i])
        	j = j + 1
   	   	end
	 i = i+1
    end
    if frame.args[i]==nil then
    	return string.format("%s\n",string)
    else
    	string = string.format("%s\n%s%s%s",string, "<div class=\"mw-collapsible mw-collapsed\" style=\"width:20%\">\'\'\'", frame.args["כותרת"],"\'\'\'<div class=\"mw-collapsible-content\" style=\"width:500%\">")
    	while (j <=60) and not (frame.args[i]==nil) do
    	    if not (frame.args[i]=="") then
           	    string = string.format("%s\n%s",string,frame.args[i])
                j = j + 1
           	end
			i = i+1
    	end
    end
	return string.format("%s</div></div>",string)
end

return {
    ['הצג מספר שורות'] = lines,
}