« Module:Procédure » : différence entre les versions
Page créée avec « local Procedure = {} local p = {} function Procedure:new(title, script, description, level, sous_procedures) self.__index = self self.title = title self.script = script self.description = description if level ~= nil then self.level = level else self.level = 3 end if sous_procedure ~= nil then self.sous_procedures = sous_procedures else self.sous_procedures = {} end end function Procedure:bu... » |
Aucun résumé des modifications |
||
| Ligne 2 : | Ligne 2 : | ||
local p = {} | local p = {} | ||
function Procedure:new(title, script, description, level, sous_procedures) | function Procedure:new(title, script, description, level, sous_procedures, arguments) | ||
self.__index = self | self.__index = self | ||
self.title = title | self.title = title | ||
| Ligne 30 : | Ligne 30 : | ||
root:wikitext(string.rep("=", self.level) .. title .. string.rep("=", self.level)) | root:wikitext(string.rep("=", self.level) .. title .. string.rep("=", self.level)) | ||
if self.script ~= nil then | if self.script ~= nil then | ||
root:wikitext(self.script:build()) | root:wikitext(self.script:build(self.arguments)) | ||
end | end | ||
if self.description ~= nil then | if self.description ~= nil then | ||
| Ligne 40 : | Ligne 40 : | ||
function p:main(frame) | function p:main(frame) | ||
local procedure = Procedure:new(frame.args[1], frame.args[2], frame.args[3], frame.args[4], frame.args[5]) | local procedure = Procedure:new(frame.args[1], frame.args[2], frame.args[3], frame.args[4], frame.args[5], frame.args[6]) | ||
return procedure:build() | return procedure:build() | ||
end | end | ||
return p | return p | ||