local i =
function i.exists(pagename) local t = mw.title.new(pagename, "Template") return t.existsend
function i.pcase(word) return mw.ustring.upper(mw.ustring.sub(word,1,1)) .. mw.ustring.sub(word,2)end
function i._subtree(pagename) local finalresult local out = local tt local temppage local temppageexists local r = 0 local t = local removeditem1 = "" local removeditem2 = "" -- 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))
while (#t > 1) do if r
temppage = table.concat(t, "-") .. "-stub" temppageexists = i.exists(temppage) if temppageexists
0 then temppage = removeditem1 .. "-stub" end temppageexists = i.exists(temppage) if temppageexists
finalresult = '
' finalresult = finalresult .. '
Stub hierarchy' finalresult = finalresult .. table.concat(out, "\n* ") finalresult = finalresult .. '\n* Stub' finalresult = finalresult .. '\n' return finalresultend
function i.subtree(frame) return i._subtree(frame.args["pagename"])end
return i