Module:PageNotice

From Candypedia
Revision as of 09:58, 31 May 2024 by 165.225.232.199 (talk) (Created page with "local p = {} function p.checkCategory(frame) local categories = { ["Needs Polish"] = "Notice Needs Polish", ["Stub"] = "Notice Stub", ["Stub for LLM content"] = "Notice Stub for LLM content", ["Raw LLM output"] = "Notice LLM raw" } for category, notice in pairs(categories) do if mw.title.getCurrentTitle():inCategory(category) then return frame:expandTemplate{ title = notice } end end retur...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:PageNotice/doc

local p = {}

function p.checkCategory(frame)
    local categories = {
        ["Needs Polish"] = "Notice Needs Polish",
        ["Stub"] = "Notice Stub",
        ["Stub for LLM content"] = "Notice Stub for LLM content",
        ["Raw LLM output"] = "Notice LLM raw"
    }

    for category, notice in pairs(categories) do
        if mw.title.getCurrentTitle():inCategory(category) then
            return frame:expandTemplate{ title = notice }
        end
    end

    return ""  -- Return an empty string if no category matches
end

return p