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"
    }

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

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

return p