Module:Shortcut: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(Created page with "local p = {} function p.main(frame) local args = frame:getParent().args return p._main(args) end function p._main(args) local div = mw.html.create('div') :addClass('shortcut noprint plainlist') :wikitext('Shortcut') local numargs = 0 for i, v in ipairs(args) do numargs = numargs + 1 end if numargs > 1 then div:node('s') end div:node(':') local list = div:tag('ul')...") |
(No difference)
|
Latest revision as of 23:36, 15 October 2024
Module documentation
This documentation is transcluded from Template:No documentation/doc. [edit] [history] [purge]
This module does not have any documentation. Please consider adding documentation at Module:Shortcut/doc. [edit]
Module:Shortcut's function main is invoked by Template:Shortcut.
local p = {}
function p.main(frame)
local args = frame:getParent().args
return p._main(args)
end
function p._main(args)
local div = mw.html.create('div')
:addClass('shortcut noprint plainlist')
:wikitext('[[RuneScape:Shortcut|Shortcut]]')
local numargs = 0
for i, v in ipairs(args) do
numargs = numargs + 1
end
if numargs > 1 then
div:node('s')
end
div:node(':')
local list = div:tag('ul')
for i, v in ipairs(args) do
list:tag('li'):wikitext('[[' .. v .. ']]')
end
return tostring(div)
end
--[[ DEBUG COPYPASTA
= p._main({'Link 1', 'Link 2', 'Link 3', 'Link 4'})
--]]
return p