Difference between revisions of "Module:Navseasoncats/navyear/sandbox"
Jump to navigation
Jump to search
blackwiki>Tom.Reding m (test arg1) |
blackwiki>Tom.Reding m (Undid revision 866838191 by Tom.Reding (talk) working) |
||
| Line 7: | Line 7: | ||
local arg2 = tonumber(frame.args[2]) | local arg2 = tonumber(frame.args[2]) | ||
local arg3 = frame.args[3] | local arg3 = frame.args[3] | ||
| − | + | return '{| class="toccolours hlist" style="text-align: center; margin: auto;"\n' .. | |
| − | |||
'|\n' .. | '|\n' .. | ||
'*'..frame:expandTemplate{ title = 'LinkCatIfExists2', args = { arg1..' '..(arg2-5)..' '..arg3, (arg2-5) } }..'\n' .. | '*'..frame:expandTemplate{ title = 'LinkCatIfExists2', args = { arg1..' '..(arg2-5)..' '..arg3, (arg2-5) } }..'\n' .. | ||
| Line 21: | Line 20: | ||
'*'..frame:expandTemplate{ title = 'LinkCatIfExists2', args = { arg1..' '..(arg2+4)..' '..arg3, (arg2+4) } }..'\n' .. | '*'..frame:expandTemplate{ title = 'LinkCatIfExists2', args = { arg1..' '..(arg2+4)..' '..arg3, (arg2+4) } }..'\n' .. | ||
'*'..frame:expandTemplate{ title = 'LinkCatIfExists2', args = { arg1..' '..(arg2+5)..' '..arg3, (arg2+5) } }..'\n' .. | '*'..frame:expandTemplate{ title = 'LinkCatIfExists2', args = { arg1..' '..(arg2+5)..' '..arg3, (arg2+5) } }..'\n' .. | ||
| − | '|}' | + | '|}' |
end | end | ||
return p | return p | ||
Revision as of 21:49, 1 November 2018
Documentation for this module may be created at Module:Navseasoncats/navyear/sandbox/doc
local p = {}
function p.navyear(frame)
--Expects a PAGENAME of the form "Some sequential 2015 example cat", where {{{1}}}=Some sequential, {{{2}}}=2015, {{{3}}}=example cat,
--TODO: and an optional 'minumum year' parameter {{{4}}}=1758
local arg1 = frame.args[1]
local arg2 = tonumber(frame.args[2])
local arg3 = frame.args[3]
return '{| class="toccolours hlist" style="text-align: center; margin: auto;"\n' ..
'|\n' ..
'*'..frame:expandTemplate{ title = 'LinkCatIfExists2', args = { arg1..' '..(arg2-5)..' '..arg3, (arg2-5) } }..'\n' ..
'*'..frame:expandTemplate{ title = 'LinkCatIfExists2', args = { arg1..' '..(arg2-4)..' '..arg3, (arg2-4) } }..'\n' ..
'*'..frame:expandTemplate{ title = 'LinkCatIfExists2', args = { arg1..' '..(arg2-3)..' '..arg3, (arg2-3) } }..'\n' ..
'*'..frame:expandTemplate{ title = 'LinkCatIfExists2', args = { arg1..' '..(arg2-2)..' '..arg3, (arg2-2) } }..'\n' ..
'*'..frame:expandTemplate{ title = 'LinkCatIfExists2', args = { arg1..' '..(arg2-1)..' '..arg3, (arg2-1) } }..'\n' ..
'*<b>'..arg2..'</b>\n' ..
'*'..frame:expandTemplate{ title = 'LinkCatIfExists2', args = { arg1..' '..(arg2+1)..' '..arg3, (arg2+1) } }..'\n' ..
'*'..frame:expandTemplate{ title = 'LinkCatIfExists2', args = { arg1..' '..(arg2+2)..' '..arg3, (arg2+2) } }..'\n' ..
'*'..frame:expandTemplate{ title = 'LinkCatIfExists2', args = { arg1..' '..(arg2+3)..' '..arg3, (arg2+3) } }..'\n' ..
'*'..frame:expandTemplate{ title = 'LinkCatIfExists2', args = { arg1..' '..(arg2+4)..' '..arg3, (arg2+4) } }..'\n' ..
'*'..frame:expandTemplate{ title = 'LinkCatIfExists2', args = { arg1..' '..(arg2+5)..' '..arg3, (arg2+5) } }..'\n' ..
'|}'
end
return p