Module:Gallery:修订间差异

H萌娘,万物皆可H的百科全书!
跳到导航 跳到搜索
imported>Irukaza
无编辑摘要
imported>Irukaza
无编辑摘要
第11行: 第11行:
local filearg = ''
local filearg = ''
local height = '120'
local height = '120'
local prependarg = '[[File:'
local prependarg = '[['
local apprendarg = '|center|frameless|' .. 'x' .. height .. 'px]]'
local apprendarg = '|center|frameless|' .. 'x' .. height .. 'px]]'

2022年3月17日 (四) 09:29的版本

Template-info.svg 模块文档  [创建] [刷新]
local getArgs = require('Module:Arguments').getArgs
local p = {}
local root

function p.main(frame)
	local args = getArgs(frame)
	return p._main(args)
end

function p._main(args)
	local filearg = ''
	local height = '120'
	local prependarg = '[['
	local apprendarg = '|center|frameless|' .. 'x' .. height .. 'px]]'
	
	for key,value in pairs(args) do
	    	filearg = filearg .. '<td>' .. prependarg .. args[key] .. apprendarg .. '</td>'
	end
	
	root = mw.html.create('table')
	root
		:addClass('gallerytable')
		:tag('tr')
			:wikitext( filearg )
	
	return tostring(root)
end

return p