Jump to content

Module:Sandbox/Awesome Aasim/Frame

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Awesome Aasim (talk | contribs) at 19:37, 30 November 2024 (Created page with '--- 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(...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

--- 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