Module:User:Catonif/surf

From Wiktionary, the free dictionary
Jump to navigation Jump to search

This is a private module sandbox of Catonif, for their own experimentation. Items in this module may be added and removed at Catonif's discretion; do not rely on this module's stability.


local export = {};

function export.main(frame)
	local args = frame:getParent().args;
	local template_name = args[1];
	local new_args = {};
	for i, v in pairs(args) do
		local num = tonumber(i);
		if (num) then
			if (num ~= 1) then
				new_args[num - 1] = v;
			end
		else
			new_args[i] = v;
		end
	end
	new_args.nocap = true;
	return (args.nocap and 'b' or 'B')
		.. 'y [[Appendix:Glossary#surface analysis|surface analysis]], '
		.. frame:expandTemplate { title = template_name, args = new_args };
end

return export;