پودمان:Further

از ویکی‌وحدت
نسخهٔ تاریخ ‏۱۳ اکتبر ۲۰۲۰، ساعت ۱۱:۵۰ توسط Mohsenmadani (بحث | مشارکت‌ها) (صفحه‌ای تازه حاوی «--[[ -- This module produces a "Further information: a, b and c" link. It implements -- the {{further}} template. --]] local mHatnote = re...» ایجاد کرد)
(تفاوت) → نسخهٔ قدیمی‌تر | نمایش نسخهٔ فعلی (تفاوت) | نسخهٔ جدیدتر ← (تفاوت)

توضیحات این پودمان می‌تواند در پودمان:Further/توضیحات قرار گیرد.

--[[
-- This module produces a "Further information: a, b and c" link. It implements
-- the {{further}} template.
--]]

local mHatnote = require('Module:Hatnote')
local mTableTools -- lazily initialise
local mArguments -- lazily initialise

local p = {}

function p.further(frame)
	mTableTools = require('Module:TableTools')
	mArguments = require('Module:Arguments')
	local args = mArguments.getArgs(frame, {parentOnly = true})
	local pages = mTableTools.compressSparseArray(args)
	if #pages < 1 then
		return mHatnote.makeWikitextError(
			'نام هیچ صفحه‌ای تعیین نشده است',
			'الگو:بیشتر#خطاها',
			args.category
		)
	end
	local options = {
		selfref = args.selfref
	}
	return p._further(options, unpack(pages))
end

function p._further(options, ...)
	local links = mHatnote.formatPages(...)
	local text = 'اطلاعات بیشتر: ' .. mw.text.listToText(links)
	return mHatnote._hatnote(text, options)
end

return p