View source for Module:Sort

From The Goon Show Depository

You do not have permission to edit this page, for the following reason:

The action you have requested is limited to users in the group: Users.


You can view and copy the source of this page.

local getArgs = require('Module:Arguments').getArgs
local p = {}
local demo = function(s) return '<' .. string.sub(s,2,-8) .. '</span>' end
-- Protect against sortkey nesting.
-- Example: {{sort|{{dts|2013|07|07}}|{{dts|1990|12|01}}}}
local encode = function(s) return (string.find(s, "sortkey") or string.find(s, "data-sort-value"))
and "" or mw.text.encode(s) end
function p._name(args)
local sortkey = encode( ((args[4] or args.sort or '') ~= '')
and (args[4] or args.sort)
or ((args[2] or args.last or '{{{last}}}')..', '..(args[1] or args.first or '{{{first}}}')))
local span = (args[1] or args.first or '{{{first}}}')..' '..(args[2] or args.last or '{{{last}}}')
if ((args.nolink or '') == '') and ((args[1] or args.first or '')..(args[2] or args.last or '')..(args.dab or '') ~= '-') then
if (args[3] or args.link or '') ~= '' then
span = (args[3] or args.link) .. '|' .. span
elseif (args.dab or '') ~= '' then
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
000
1:0
Debug console
* The module exports are available as the variable "p", including unsaved modifications. * Precede a line with "=" to evaluate it as an expression or use print(). Use mw.logObject() for tables. * Use mw.log() and mw.logObject() in module code to send messages to this console.

Return to Module:Sort.