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

Content deleted Content added
positional parameters are all valid + recognize topic1
bug squashing
Line 55:
local args = require('Module:Arguments').getArgs(frame)
local sectionParameter = yesno(args.section, args.section) or yesno(args.relatedcontent, args.relatedcontent) -- whether we are sections all the way down
local completeTopics, partialTopics = collectTopics(args, sectionParameter) -- completeTopics is a sequence. partialTopics is a table with topics as keys and scope as values
local restrictions = {} -- A list of which restrictions are enabled for easier iteration
local restrictionFlags = {} -- Track which restrictions are enabled, as a set
Line 203:
elseif scope then
-- scope is not nil, so we write that into the bullet point
addToMessage('* <b>' .. topicBlurb .. '</b>, specifically the parts about <b>' .. scope .. '</b>\n')
else
-- scope is nil, so we have nothing to add
Line 230:
messageBody = '<b>The [[Wikipedia:Contentious topics|contentious topics]] procedure applies to this ' .. articleOrPage .. '.</b>'
 
-- if there's only one topic, we make a short blurb
if numberOfTopics == 1 then
Line 391:
end
-- checking for unknown parameters with extensible templatesmodules is annoying; the module is primarily intended for hardcoded stuff
-- luckily, it makes use of a table for its main settings, and we can do some clever stuff with that
Line 413:
-- then add all of the partialTopics section parameters
for code, _ in pairs(partialTopics) do
addKnownParameter(code .. '-section')
end