Module:DYK checklist
Appearance
![]() | This module depends on the following other modules: |
![]() | This Lua module is used on approximately 20,000 pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them. |
This module implements {{DYK checklist}}. Please see the template page for documentation.
-- This module implements {{DYK checklist}}.
local yesno = require('Module:Yesno')
local params = {
newness = true,
length = true,
eligibilityother = true,
sourced = true,
neutral = true,
plagiarismfree = true,
policyother = true,
hookcited = true,
hookother = true,
hookcited = true,
picfree = true,
picused = true,
picclear = true,
}
-- The template for making collapsed sections.
local COLLAPSE_TEMPLATE = [[
{| class="collapsible collapsed" border="1" style="border-collapse:collapse;"
|-
! style="font-weight:normal; " | %s
|-
| %s
|}]]
local p = {}
-- If a value is not present for a canonical key in the args table, check if
-- there is a value for an alias key, and write that value to the canonical
-- key. Then delete the alias key, whether or not a canonical value is present.
-- Called like this: consolidateAliases(args, {
-- canonicalKey1 = {'alias1', 'alias2'},
-- canonicalKey2 = {'anotherAlias1', 'anotherAlias2'},
-- })
-- The args table is altered in place; the function returns nil.
local function consolidateAliases(args, aliases)
for argName, aliases in pairs(aliases) do
for i, alias in ipairs(aliases) do
if not args[argName] and args[alias] then
args[argName] = args[alias]
end
args[alias] = nil
end
end
return nil
end
-- Make a collapsed wikitable with the given header and content.
local function makeCollapsedWikitable(header, content)
return string.format(COLLAPSE_TEMPLATE, header, content)
end
local function buildBulletedList()
end
local function determineGeneralEligibility()
end
local function determinePolicyCompliance()
end
local function determineHookEligibility()
end
local function determineImageEligibility()
end
local function determineQPQ()
end
function p._main(args)
consolidateAliases(args, {plagiarismfree = {'plagarismfree'}})
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:DYK checklist',
})
return p._main(args)
end
return p