Module:Su: Difference between revisions
m Changed protection level for "Module:Su": Highly visible template -upgrading to match template ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite)) |
Richardpruen (talk | contribs) m 1 revision imported: Templates and CSS files |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 8: | Line 8: | ||
-- uses named arguments, and whitespace is trimmed from them automatically. | -- uses named arguments, and whitespace is trimmed from them automatically. | ||
local origArgs = frame:getParent().args | local origArgs = frame:getParent().args | ||
local args = {} | |||
for k, v in pairs(origArgs) do | |||
if v ~= '' then | |||
args[k] = v | |||
end | |||
end | |||
-- Define the variables to pass to luaMain. | |||
local sup = args.p | |||
local sub = args.b | |||
local options = { | |||
align = args.a, | |||
fontSize = args.w, | |||
lineHeight = args.lh, | |||
verticalAlign = args.va | |||
} | |||
return p._main(sup, sub, options) | |||
end | |||
function p.invoke_main(frame) | |||
-- entry point for invocation using frame arguments | |||
local origArgs = frame.args | |||
local args = {} | local args = {} | ||
for k, v in pairs(origArgs) do | for k, v in pairs(origArgs) do |