มอดูล:Further
นี่เป็นมอดูลที่ถูกป้องกันถาวรเนื่องจากมีความเสี่ยงสูง กรุณาอภิปรายการเปลี่ยนแปลงใด ๆ ทางหน้าคุย คุณอาจส่งคำขอแก้ไขไปยังผู้ดูแลระบบเพื่อให้แก้ไขได้หากเป็นการแก้ไขที่ไม่มีการคัดค้านหรือมีความเห็นพ้องสนับสนุน คุณยังสามารถขอให้เลิกป้องกันหน้าได้ |
คู่มือการใช้งานมอดูล[สร้าง]
คุณอาจจะต้องการสร้างคู่มือการใช้งานของมอดูลนี้ ผู้เขียนสามารถทำการทดลองได้ที่กระบะทราย (สร้าง | คัดลอก) และชุดทดสอบ (สร้าง) ของมอดูลนี้ โปรดเพิ่มหมวดหมู่ไปที่หน้าย่อย /doc หน้าย่อยของมอดูลนี้ |
--[[
-- 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(
'no page names specified',
'แม่แบบ:ข้อมูลเพิ่มเติม#Errors',
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