end
--[[------------------------< getNamegetCanonicalCode >---------------------------------
Gets the fullcanonical namecode offor a task force. return tfData.canonicalCode
]]----------------------------------------------------------------------------
function p.getName(frame)
local args = getArgs(frame, { parentFirst = true })
local tfData = p._main(args)
if tfData then
return tfData.name
end
return nil
end
--[[------------------------< getNestedName >---------------------------------
Gets the nested name of a task force.
]]----------------------------------------------------------------------------
function p.getNestedName(frame)
local args = getArgs(frame, { parentFirst = true })
local tfData = p._main(args)
if tfData then
return tfData.nested
end
return nil
end
--[[------------------------< getImage >---------------------------------
Gets the image filename for a task force.
]]----------------------------------------------------------------------------
function p.getImage(frame)
local args = getArgs(frame, { parentFirst = true })
local tfData = p._main(args)
if tfData then
return tfData.image
end
return nil
end
--[[------------------------< getCategory >---------------------------------
Gets the category name for a task force.
]]----------------------------------------------------------------------------
function p.getCategory(frame)
local args = getArgs(frame, { parentFirst = true })
local tfData = p._main(args)
if tfData then
return tfData.category
end
return nil
end
--[[------------------------< getLink >---------------------------------
Gets the project link for a task force.
]]----------------------------------------------------------------------------
function p.getLink(frame)
local args = getArgs(frame, { parentFirst = true })
local tfData = p._main(args)
if tfData then
return tfData.link
end
return nil
end
--[[------------------------< getCanonicalCode >---------------------------------
Gets the canonical code for a task force.
]]----------------------------------------------------------------------------
function p.getCanonicalCode(frame)
local args = getArgs(frame, { parentFirst = true })
local tfData = p._main(args)
if tfData then
return tfData.canonicalCode
end
return nil
end
function p.main(frame)
local args = getArgs(frame, { parentFirst = true })
return p._main(args)
end
function p.hello(frame)
return "|MAIN_TEXT = feline"
end
-- Takes an input string "r" in the form "|a=b" (no spaces around the =) used in templates and adds it to the table
function p.tab2arg(trable,r)
local t = mw.text.split(r, "=", true, true) -- Split by comma, trim whitespace, remove empty strings
end
-- Adds an element to a table (syntactic sugar)
function p.ma1(frame,s1,s2)
frame[s1]=s2
end
--[[ pulls out our specially named parameter from the list of template-like args, and expands
it into the appropriate task force table entries
]]--
function p.fudgeTaskforceParameters(frame)
local args = getArgs(frame, { parentFirst = true })
local taskforcesStr = ""
taskforcesStr = args["HEET_TASKFORCEHETF_TASKFORCES_TO_EXPAND"]
if not taskforcesStr then
return "oops"
end
-- More or less a wrapper for WikiProject Banner with some argument sweetening
function p.fudgehetf_banner(frame)
local oframe=frame
frame=p.fudgeTaskforceParameters(frame)
return str[1]
end
function p.tester(frame)
local str=""
str = str .. "hello"
local r="|IMAGE_LEFT =Graduation hat.svg"
local t = mw.text.split(r, "=", true, true) -- Split by comma, trim whitespace, remove empty strings
local x = mw.text.split(t[1], "|", true, true) -- Split by comma, trim whitespace, remove empty strings
return t[2]
end
|