|
-- Simple Module that passes all arguments in the parent frame to a specified template pa = ; function pa.run( frame ) local template = frame.args.template or frame.args; local pframe = frame:getParent(); local exclude = frame.args.exclude or ''; local exclude_list = ; for val in string.gmatch( exclude, ' *' ) do table.insert( exclude_list, val ); end local result; args = ; for k,v in pairs( pframe.args ) do local good = true; for _, v2 in ipairs( exclude_list ) do if k == v2 then good = false; end end if good then args = v; end end result = frame:expandTemplate( ); return result; end function pa.list( frame ) local template = frame.args.template or frame.args; local pframe = frame:getParent(); local exclude = frame.args.exclude or ''; local exclude_list = ; for val in string.gmatch( exclude, ' *' ) do table.insert( exclude_list, val ); end local result; args = ; for k,v in pairs( pframe.args ) do local good = true; for _, v2 in ipairs( exclude_list ) do if k == v2 then good = false; end end if good then table.insert( args, k .. '=' .. v ); end end -- result = ''; result = frame:preprocess(' return result; end return pa 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「モジュール:PassArguments」の詳細全文を読む スポンサード リンク
|