切換選單
切換偏好設定選單
切換個人選單
尚未登入
若您做出任何編輯,會公開您的 IP 位址。

模組:Infobox

出自卡特霍普
於 2025年6月14日 (六) 21:59 由 GTEH留言 | 貢獻 所做的修訂 (建立內容為「local capiunto = require 'capiunto' local p = {} function p.main(frame) local args = frame:getParent().args local retval = capiunto.create( { title = args.title, top = args.top, bottom = args.bottom, } ) if args.subtitle and args.subtitle ~= '' then retval:addSubHeader( args.subtitle ) end if args.image1 and args.image1 ~= '' then retval:addImage( args.image1, args.caption1 ) end if args.image2 and args.image2 ~= '' then retval:addImage…」的新頁面)
(差異) ←上個修訂 | 最新修訂 (差異) | 下個修訂→ (差異)

可在模組:Infobox/doc建立此模組的說明文件

local capiunto = require 'capiunto'

local p = {}

function p.main(frame)
	local args = frame:getParent().args
	local retval = capiunto.create( {
		title = args.title,
		top = args.top,
		bottom = args.bottom,
	} )
	if args.subtitle and args.subtitle ~= '' then
		retval:addSubHeader( args.subtitle )
	end
	if args.image1 and args.image1 ~= '' then
		retval:addImage( args.image1, args.caption1 )
	end
	if args.image2 and args.image2 ~= '' then
		retval:addImage( args.image2, args.caption2 )
	end
	if args.header1 and args.header1 ~= '' then
		retval:addHeader( args.header1 )
	end
	if args.data1 and args.data1 ~= '' then
		retval:addRow( args.label1, args.data1 )
	end
	if args.header2 and args.header2 ~= '' then
		retval:addHeader( args.header2 )
	end
	if args.data2 and args.data2 ~= '' then
		retval:addRow( args.label2, args.data2 )
	end
	if args.header3 and args.header3 ~= '' then
		retval:addHeader( args.header3 )
	end
	if args.data3 and args.data3 ~= '' then
		retval:addRow( args.label3, args.data3 )
	end
	if args.header4 and args.header4 ~= '' then
		retval:addHeader( args.header4 )
	end
	if args.data4 and args.data4 ~= '' then
		retval:addRow( args.label4, args.data4 )
	end
	if args.header5 and args.header5 ~= '' then
		retval:addHeader( args.header5 )
	end
	if args.data5 and args.data5 ~= '' then
		retval:addRow( args.label5, args.data5 )
	end
	if args.header6 and args.header6 ~= '' then
		retval:addHeader( args.header6 )
	end
	if args.data6 and args.data6 ~= '' then
		retval:addRow( args.label6, args.data6 )
	end
	if args.header7 and args.header7 ~= '' then
		retval:addHeader( args.header7 )
	end
	if args.data7 and args.data7 ~= '' then
		retval:addRow( args.label7, args.data7 )
	end
	if args.header8 and args.header8 ~= '' then
		retval:addHeader( args.header8 )
	end
	if args.data8 and args.data8 ~= '' then
		retval:addRow( args.label8, args.data8 )
	end
	if args.header9 and args.header9 ~= '' then
		retval:addHeader( args.header9 )
	end
	if args.data9 and args.data9 ~= '' then
		retval:addRow( args.label9, args.data9 )
	end
	if args.header10 and args.header10 ~= '' then
		retval:addHeader( args.header10 )
	end
	if args.data10 and args.data10 ~= '' then
		retval:addRow( args.label10, args.data10 )
	end
	return retval
end

return p