More actions
en>Alistair3149 No edit summary |
en>Alistair3149 No edit summary |
||
Line 11: | Line 11: | ||
if not args then | if not args then | ||
return 'Missing arguments' | return 'Missing arguments' | ||
end | end | ||
Revision as of 06:59, 17 March 2024
Template loop detected: Module:Navpills/doc
local mArguments --initialize lazily
local p = {}
--Implements {{Navpills}} from the frame
function p.navpills( frame )
mArguments = require( 'Module:Arguments' )
return p._navpills( mArguments.getArgs( frame ) )
end
function p._navpills( args )
if not args then
return 'Missing arguments'
end
local html = mw.html.create( 'div' ):addClass( 'template-navpills' )
for i, arg in ipairs( args ) do
--if not arg[ 'page' .. i ] or not arg[ 'text' .. i ] then return
local num = tostring( i )
html:wikitext( arg[ 'page' .. num ] )
html:wikitext( arg[ 'text' .. num ] )
--html:wikitext( string.format( '[[%s|%s]]' ), arg[ 'page' .. num ], arg[ 'text' .. num ] )
end
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Navpills/styles.css' }
} .. tostring( html )
end
return p