יחידה:מיון אלפביתי

ניתן ליצור תיעוד על היחידה הזאת בדף יחידה:מיון אלפביתי/תיעוד

function sort_and_dash( frame )
    local t = {}
    for i, str in ipairs(frame.args) do -- loop over all the unnamed (order-based) parameters
		str = mw.text.trim(str)       
		if str ~= '' then -- filter empty/whitespace parameters - users often add extra | 
		    table.insert(t, str)
		end
	end
    table.sort(t)
    return table.concat(t, '–')
end

function sort_and_smart_dash( frame )
    local t = {}
    local space = false
    for i, str in ipairs(frame.args) do
		str = mw.text.trim(str)       
		if str ~= '' then
		    table.insert(t, str)
		    if not space and string.find(str, " ") then
		    	space = true
		    end
		end
	end
    table.sort(t)
    if space then
    	return table.concat(t, ' – ')
    else
    	return table.concat(t, '–')
    end
end

return {
	['מיון'] = sort_and_dash,
	['מיון2'] = sort_and_smart_dash,	
}