模組:Good article topics
外观
模块文档[创建]
您可能想要创建本Scribunto模块的文档。 编者可以在本模块的沙盒 (创建 | 镜像)和测试样例 (创建)页面进行实验。 请在/doc子页面中添加分类。本模块的子页面。 |
-- This module implements {{GA/Topic}}.
local p = {}
function p.main(frame)
local topic = frame:getParent().args[1]
if not topic then
return ''
end
topic = topic:match('^%s*(.-)%s*$') -- Trim whitespace
local ret
if topic ~= '' then
ret = p._main(topic)
end
ret = ret or ''
return ret
end
function p._main(topic)
topic = topic:lower()
local data = mw.loadData('Module:Good article topics/data')
return data[topic]
end
return p