Final Fantasy Wiki
m (relink both categories)
m (whoops)
Line 7: Line 7:
 
local args = getArgs(frame)
 
local args = getArgs(frame)
 
local reason = "for one or more reasons"
 
local reason = "for one or more reasons"
local categories = "[[Category:Incomplete table]]"
+
local categories = "[[Category:Table incomplete]]"
   
 
for _, arg in ipairs(args) do
 
for _, arg in ipairs(args) do
 
if data[arg] then
 
if data[arg] then
categories = categories .. "[[Category:Incomplete table (" .. data[arg].name .. ")]]"
+
categories = categories .. "[[Category:Table incomplete (" .. data[arg].name .. ")]]"
 
else
 
else
 
reason = "and require the " .. arg .. " entries to be filled"
 
reason = "and require the " .. arg .. " entries to be filled"

Revision as of 18:16, 13 January 2020

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

-- <nowiki>
local p = {}
local data = require("Module:Codename").tables.rel
local getArgs = require("Dev:Arguments").getArgs

function p.main(frame)
    local args = getArgs(frame)
    local reason = "for one or more reasons"
    local categories = "[[Category:Table incomplete]]"

    for _, arg in ipairs(args) do
        if data[arg] then
            categories = categories .. "[[Category:Table incomplete (" .. data[arg].name .. ")]]"
        else
            reason = "and require the " .. arg .. " entries to be filled"
        end
    end

    return "The following tables are incomplete " .. reason .. ". If you wish, please examine the table and add anything missing. Remove this notice upon completion." .. categories
end

return p
-- <nowiki>