求真百科歡迎當事人提供第一手真實資料,洗刷冤屈,終結網路霸凌。

模組:Further檢視原始碼檢視歷史

事實揭露 揭密真相
於 2018年7月23日 (一) 14:33 由 Oceanside對話 | 貢獻 所做的修訂 (导入1个版本)
(差異) ←上個修訂 | 最新修訂 (差異) | 下個修訂→ (差異)
前往: 導覽搜尋

此模塊的文檔可以在模塊:Further/doc創建

--[[
-- This module produces a "Further information" link. It implements
-- the {{further}} template.
--]]

local mHatnote = require('Module:Hatnote')
local mHatlist = require('Module:Hatnote list')
local mArguments -- lazily initialise
local mTableTools -- lazily initialise
local p = {}

function p.further (frame)
	mArguments = require('Module:Arguments')
	mLabels = require('Module:Labelled list hatnote')
	local args = mArguments.getArgs(frame, {parentOnly = true})
	local topic, category = args.topic, args.category
	local options = {selfref = args.selfref}
	pages = mLabels.preprocessDisplays(args)
	if #pages == 0 then
		return mHatnote.makeWikitextError(
			'no page names specified',
			'Template:Further#Errors',
			category
		)
	end
	return p._further(pages, topic, options)
end

function p._further (pages, topic, options)
	topic = topic and (' on '..topic) or ''
	local text = string.format('Further information%s: %s', topic, mHatlist.andList(pages, true))
	return mHatnote._hatnote(text, options)
end

return p