Jump to content

Module:Signpost

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mr. Stradivarius (talk | contribs) at 13:24, 15 March 2015 (use the new index table format). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local data = mw.loadData('Module:Signpost/index')

local p = {}

function p._tag(tag)
	if not tag then
		return nil
	end
	local articles = data.tags[tag]
	if not articles then
		return nil
	end
	local ret = {}
	ret[#ret + 1] = '<ul>'
	for i, t in ipairs(articles) do
		ret[#ret + 1] = string.format(
			'<li>%s, %s: [[%s|%s]]</li>',
			t.date, t.subpage, t.page, t.title
		)
	end
	ret[#ret + 1] = '</ul>'
	return table.concat(ret, '\n')
end

function p.tag(frame)
	local tag = frame.args[1]
	return p._tag(tag)
end

return p