Module:Sandbox/Awesome Aasim/Frame
Appearance
Description | This is a debugging module that simply tabulates the arguments passed into the frame. |
---|---|
Code source | Sandbox/Awesome Aasim/Frame |
Status | Unknown |
This is a debugging module that simply tabulates the arguments passed into the frame.
Example
{{#invoke:Frame|args|Hi|there|3=How|text=are you}}
Argument | Contents |
---|---|
1 | Hi |
2 | there |
3 | How |
"text" | are you |
Documentation
--- This is a debugging module that simply tabulates the arguments passed into
-- the frame.
-- @module frame
-- @alias p
local p = {}
p.args = function(frame)
local out = mw.html.create("table")
out
:tag("tr")
:tag("th")
:wikitext('Argument')
:done()
:tag('th')
:wikitext('Contents')
:done()
for k,v in pairs(frame.args) do
out
:tag('tr')
:tag('td')
:wikitext(type(k) == type(1) and k or '"' .. k .. '"')
:done()
:tag('td')
:wikitext(v)
:done()
end
return tostring(out)
end
return p