Module:Set CSV

This is the current revision of this page, as edited by Alex (talk | contribs) at 00:13, 17 October 2024 (Created page with "local p = {} function p.main(frame) return p._main( frame:getParent().args ) end function p._main(args) local set = {} for prop, val in pairs(args) do set[prop] = mw.text.split(val, "%s*,%s*") end mw.smw.set(set) end return p"). The present address (URL) is a permanent link to this version.

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Module documentation
This documentation is transcluded from Module:Set CSV/doc. [edit] [history] [purge]
Module:Set CSV's function main is invoked by Template:Set CSV.

Converts a CSV for each named parameter to a list of values to set for the property name corresponding to that parameter.


local p = {}

function p.main(frame)
    return p._main( frame:getParent().args )
end

function p._main(args)
	local set = {}
	for prop, val in pairs(args) do
		set[prop] = mw.text.split(val, "%s*,%s*")
	end
	mw.smw.set(set)
end

return p