Difference between revisions of "Module:Sandbox"
(Return the whole frame.) |
(Iterating over args) |
||
Line 3: | Line 3: | ||
-- For testing purposes | -- For testing purposes | ||
------------------------ | ------------------------ | ||
− | + | -- <pre> | |
− | + | return { | |
− | + | main = function( frame ) | |
+ | local ret = {} | ||
− | + | for parameter, argument in pairs( frame.args ) do | |
+ | table.insert( | ||
+ | ret, | ||
+ | ( 'paramater <code>{{{%s}}}</code> was used with value <code>%s</code>' ):format( parameter, argument ) | ||
+ | ) | ||
+ | end | ||
+ | |||
+ | return '* ' .. table.concat( ret, '\n* ' ) | ||
+ | end | ||
+ | } | ||
+ | -- </pre> |
Revision as of 01:38, 11 January 2020
------------------------
-- Sandbox module:
-- For testing purposes
------------------------
-- <pre>
return {
main = function( frame )
local ret = {}
for parameter, argument in pairs( frame.args ) do
table.insert(
ret,
( 'paramater <code>{{{%s}}}</code> was used with value <code>%s</code>' ):format( parameter, argument )
)
end
return '* ' .. table.concat( ret, '\n* ' )
end
}
-- </pre>