Content deleted Content added
rewrote p.main as to not need buffer; disabled demo var in article space; more detailed comments |
m minor copyedit of comments; code should now be in a mature form |
||
Line 15:
[1] = full category name; defaults to local attention if blank
k = Category sort key. Prefix before v.t
t = page.text or args.tempsort#; appended after k or in its place if omitted; t is required if v is not a string
Basically the same as v = (v[1] or attention) .. ' | ' .. (v.k or '') .. v.t
]] link = string.format(
Line 27:
)
)
--Prevents dupli-cats... get it? Maybe not?
if not p.cats.inv[link] then
table.insert(p.cats, link)
Line 35 ⟶ 36:
end
--[[
Makes an ombox warning;
function ombox(v)▼
Will return an empty string instead when ifNot evaluates to true
▲]]function ombox(v)
if v.ifNot then
return ''
Line 49 ⟶ 52:
end
--[[
function catStub(page, pageDoc)▼
Unlike original template, module now takes unlimited cats! This function also performs
most stub category error checks except for the ombox for when main |category= is omitted (See p.template())
▲]]function catStub(page, pageDoc)
stubCats = {missing = {}, v = {}}
for k, _ in pairs(args) do
Line 104 ⟶ 110:
table.insert(stubCats, 1, false)
end
for
wikitext = wikitext .. string.format(
base,
Line 265 ⟶ 271:
end
end
return output:wikitext(
▲ category{done = not p.demo},
)
▲ p.demo == 'doc' and p.demodoc or nil
end
|