Module:SlidesToTabber

From Totem Arts Wiki
Revision as of 14:38, 15 September 2020 by RaiderAlpha (talk | contribs) (Created page with "local p = {} p.main = function(f) local args = f:getParent().args if args[1] == nil then return "" end local size = args[2] or '250px' local tabberArgs = {'tabber',''}...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:SlidesToTabber/doc

local p = {}
p.main = function(f)
	local args = f:getParent().args
	if args[1] == nil then
		return ""
	end
	local size = args[2] or '250px'
	local tabberArgs = {'tabber',''}
	for match in string.gmatch(args[1],"File:[^%c]*") do
	    local split = mw.text.split(match, "|", true)
	    local file = mw.text.trim(split[1] or '')
	    local desc = mw.text.trim(split[2] or '')
	    tabberArgs[2] = tabberArgs[2] .. "\n|-|\n "..desc.."=\n[["..file.."|"..size.."]]"
	end
	return f:callParserFunction('#tag', tabberArgs)
end
return p