Module documentation[view] [edit] [history] [purge]

This module returns an appropriate sort key for equal-step tuning-related pages to enable numerical sorting instead of alphabetical sorting.


Introspection summary for Module:ET sort key 
Functions provided (2)
Line Function Params Description
6 et_sort_key (invokable) (frame) Return a string of #'s corresponding to the size (#notes/equave) of the ET
11 _et_sort_key (main) (tuning)
Lua modules required (2)
Variable Module Functions used
getArgs Module:Arguments getArgs
ET Module:ET parse

local getArgs = require("Module:Arguments").getArgs
local ET = require("Module:ET")
local p = {}

-- return a string of #'s corresponding to the size (#notes/equave) of the ET
function p.et_sort_key(frame)
	local args = getArgs(frame)
	return p._et_sort_key(args[1])
end

function p._et_sort_key(tuning)
	local et = ET.parse(tuning)
	local size = tostring(et.size)
	local sort_key = string.rep("#", size:len())
	return sort_key
end

return p