ഘടകം:Sort list

വിക്കിപീഡിയ, ഒരു സ്വതന്ത്ര വിജ്ഞാനകോശം.

ഈ ഘടകത്തിന്റെ വിവരണം ഘടകം:Sort list/വിവരണം എന്ന താളിൽ നിർമ്മിക്കാവുന്നതാണ്

local p = {}

function p.asc(frame)
    items = splitLine( frame.args[1] );
    table.sort( items );
    return table.concat( items, "\n" );    
end

function p.desc(frame)
    items = splitLine( frame.args[1] );
    table.sort( items, function (a, b) return a > b end );
    return table.concat( items, "\n" );
end

function splitLine( text )
    return mw.text.split( text, "\n", true );    
end



return p
"https://ml.wikipedia.org/w/index.php?title=ഘടകം:Sort_list&oldid=3227313" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്