Module:Good Articles
local p = {}
p.main = function (frame)
local NNN = 2 -- provide counts only over this threshold
local args = require("Module:Arguments").getArgs(frame)
-- expect args.shortcut e.g. GA/H, args.type e.g. History, args.text a long list
local subpage = frame:preprocess("{{SUBPAGENAME}}") -- I never did look up if there's a better way to do this...
local header, shortcuts = ,
local type = args.type or "error: specify type = Good Articles type"
local image = args.image and '' .. args.image .. '' or ''
local sectioncount = 0
if (subpage == type or args.override) then -- I haven't figured out how to deal with missing shortcut so why pretend
shortcuts = frame:expandTemplate{ title = 'shortcut', args = { args.shortcut } }
header = frame:expandTemplate{ title = 'Wikipedia:Good articles/Summary', args = { shortcuts = shortcuts } }
end
local introtext = args.text or ''
replace = function(t)
local xxxx, links = mw.ustring.gsub(t, "(%[%^%[%-%]%])", "%1", nil) -- count how many links
if links >= NNN then
t = t .. " (" .. tostring(links) .. " articles)"
end
return t .. "\n"
end
local sectionfooter = [===[