Module:Based on/sandbox
Appearance
![]() | This is the module sandbox page for Module:Based on (diff). |
![]() | This Lua module is used on approximately 29,000 pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them. |
This module implements {{Based on}}
Usage
To directly call this module (all arguments except work name optional):
{{#invoke:Based on|lua_main|Work name|Writer 1|Writer 2|...}}
To call it from a template, passing on the arguments from it:
{{#invoke:Based on|main}}
local p = {}
function p._main(args)
return args[2] and string.format(
'%s <br /><div class="nowrap"><span style="vertical-align:top">by </span><div class="wrap%s" style="display:inline-block;padding-right:1.25em">%s</div></div>',
args[1],
args[3] and ' plainlist' or '',
args[3] and '\n* ' .. table.concat(args, '\n* ', 2) .. '\n'
or args[2]
)
or args[1]
end
function p.main(frame)
return p._main(mw.clone(frame:getParent().args))
end
return p