跳转到内容

模組:Good article topics

维基百科,自由的百科全书

这是Module:Good article topics当前版本,由SunAfterRain留言 | 贡献编辑于2019年5月27日 (一) 13:07 建立内容为“-- This module implements {{GA/Topic}}. local p = {} function p.main(frame) local topic = frame:getParent().args[1] if not topic then return '…”的新页面)。这个网址是本页该版本的固定链接。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)
-- 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