Modul:character simple list

A modult a Modul:character simple list/doc lapon tudod dokumentálni

local export = {}

function export.show(frame)
	local result = {}
	local args = frame.args
	local text = args[1] or ''
	local sc_code = args['sc'] or 'Zyyy'
	local prefix = args['prefix'] or ''
	local separator = args['sep'] or ', '

	for term in mw.text.gsplit(text, '') do
		if prefix == '' then
			table.insert(result, '[[' .. term .. ']]')
		else
			table.insert(result, '[[' .. prefix .. term .. '|' .. term .. ']]')
		end
	end
	return '<big class="' .. sc_code .. '" style="padding:0.5ex">' .. table.concat(result, separator) .. '</big>'
end

return export