Module:Contentious topics/talk notice/sandbox: Difference between revisions

Content deleted Content added
save a WIP
save a WIP
Line 10:
local function collectTopics(args)
local seen = {}
local topicscompleteTopics = {}
local partialTopics = {}
 
local function add(value)
if value then
value = mw.text.trim(value)
if value ~= '' and not seen[value] then
if args[value .. seen[value'-section'] = truethen
table.insert(topicspartialTopics, value, args[value .. '-section'])
else
table.insert(completeTopics, value)
end
seen[value] = true
end
end
Line 34 ⟶ 39:
end
 
return topicscompleteTopics, partialTopics
end
 
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame)
local topicscompleteTopics, partialTopics = collectTopics(args)
local completeTopics = {} -- a list of topics which apply to the entire page
local partialTopics = {} -- a table of topics which apply to part of the page. The keys are the topic, and the values are relevant part(s)
local restrictions = {} -- A list of which restrictions are enabled for easier iteration
local restrictionFlags = {} -- Track which restrictions are enabled, as a set
Line 106 ⟶ 109:
end
end
for _, topic in ipairs(topics) do
 
local additional = restrictionsDatabase["additional-available"][topic]
if additional then