Toggle menu
15
245
116
28K
Kenshi Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 21:44, 19 February 2025 by Prd (talk | contribs) (Created page with "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")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A sorting module, intended to be used with {{sort list}}.

See also



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
Contents