Module:Asbox stubtree
From Zoophilia Wiki
Documentation for this module may be created at Module:Asbox stubtree/doc
local i = {}
function i._subtree(pagename)
local out = {"",pagename}
local temp1;
local t = {}
-- split items on dash into table
for token in mw.ustring.gmatch(pagename, "[^-]+") do
-- don't add numbered items to list
if tonumber(mw.ustring.sub(token,1,1)) == nil then
table.insert(t,token)
end
end
table.remove(t, #t)
while (#t > 1) do
table.remove(t, 1)
temp1 = table.concat(t, "-") .. "-stub"
table.insert(out,temp1)
end
return table.concat(out, "\n* ")
end
function i.subtree(frame)
return i._subtree(frame.args["PAGENAME"])
end
return i