Module:Person
Appearance
Documentation for this module may be created at Module:Person/doc
local p = {}
function p.listPagesByAuthor(frame)
local args = frame.args
local author = args.author
if not author or author:match('^%s*$') then
return ''
end
local query = '[[Has author::' .. author .. ']]'
local params = {
limit = 50,
order = 'asc'
}
local pages = mw.smw.ask(query, params)
local result = {'== Works referenced in glossaLAB ==\n'}
mw.logObject(pages)
if pages == nil then
table.insert(result, '* The list is empty.')
else
for _, page in ipairs(pages) do
table.insert(result, '* ' .. page[1])
end
end
return table.concat(result, '\n')
end
return p