Документацію для цього модуля можна створити у Модуль:RandomMembers/документація
local p = {}
function p.showRandomMembers(frame)
local category = "Учасники_спільноти_MCC" -- Your category name
local pages = mw.smw.getQueryResult('[[Category:' .. category .. ']]|?Modification date|sort=Modification date|order=rand|limit=4')
if not pages or not pages.results then
return "No results found."
end
local output = {}
for _, page in ipairs(pages.results) do
local title = page.fullText or page.title
table.insert(output, string.format('<p><a href="/wiki/%s">%s</a></p>', mw.uri.encode(title, 'WIKI'), title))
end
return table.concat(output, "\n")
end
return p