Module:Subobjecthelper

From Illerai
Jump to navigation Jump to search
Module documentation
This documentation is transcluded from Module:Subobjecthelper/doc. [edit] [history] [purge]

This template should be used when there is no documentation for a Module or Template.


local p = {}

function p.main(frame)
	local args = frame.args
	local subobj = {}
	for k,v in pairs(args) do
		if not (k == 'splitpoint' or k == 'subobjectname') then
			v = v:gsub('[\r\n]', '')
			subobj[k] = mw.text.split(v, args.splitpoint or '&split&')
		end
	end
	if args.subobjectname then
		mw.smw.subobject(subobj, args.subobjectname)
	else	
		mw.smw.subobject(subobj)
	end
end

return p