Module:Variable arguments: Difference between revisions

ArrowHead294 (talk | contribs)
Realised I was working on the wrong function all along when testing out breadcrumb
ArrowHead294 (talk | contribs)
mNo edit summary
Line 34: Line 34:
.. string.format("This template uses [[wikipedia:WP:Lua|Lua]]:\n%s</span>\n", result)
.. string.format("This template uses [[wikipedia:WP:Lua|Lua]]:\n%s</span>\n", result)
.. "|}\n</div>"
.. "|}\n</div>"
return frame:preprocess(debugg == true and "<pre>" .. result .. "</pre>" or result)
return frame:preprocess(debugg == true and "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>" or result)
end
end


Line 41: Line 41:
     parentOnly = true
     parentOnly = true
     })
     })
    local debugg = yesno(frame.args.debug_mode or args.debug_mode)
local result = ""
local result = ""
local i = 0
local i = 0
Line 56: Line 57:
end
end
return frame:preprocess(result)
return frame:preprocess(debugg == true and "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>" or result)
end
end


function p.wikipedia(frame)
function p.wikipedia(frame)
local args = mArguments.getArgs(frame, {
local args = mArguments.getArgs(frame, {
parentOnly = true
    parentOnly = true
})
    })
    local debugg = yesno(frame.args.debug_mode or args.debug_mode)
local result = ""
local result = ""
local i = 0
local i = 0
Line 85: Line 87:
    .. string.format("English [[Wikipedia:Main Page|Wikipedia]] has %s on:\n%s</div>", (i > 1 and "articles" or "an article"), result)
    .. string.format("English [[Wikipedia:Main Page|Wikipedia]] has %s on:\n%s</div>", (i > 1 and "articles" or "an article"), result)
    .. "{{clear}}</div>"
    .. "{{clear}}</div>"
return frame:preprocess(result)
return frame:preprocess(debugg == true and "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>" or result)
end
end