Module:Good article topics

MyWikiBiz, Author Your Legacy — Friday March 29, 2024
Revision as of 21:53, 15 July 2021 by Zoran (talk | contribs) (Pywikibot 6.4.0)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Template:Module rating

This module implements Template:GA/Topic; please see the template page for documentation.

The topic name data is stored at Module:Good article topics/data.


-- 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