local p =
local function errorf(level, ...) if type(level)
-- From .local function defaultKeySort(key1, key2) -- "number" < "string", so numbers will be sorted before strings. local type1, type2 = type(key1), type(key2) if type1 ~= type2 then return type1 < type2 else return key1 < key2 endend
function p.make_param_list(params_set) local params_sorted = for param_name in pairs(params_set) do table.insert(params_sorted, param_name) end table.sort(params_sorted, defaultKeySort) return params_sortedend
function p.get_parameters(pagename) local page if type(pagename)
"table" and pagename.nsText then page = pagename pagename = page.fullText else errorf("Bad argument #1 to get_parameters (expected pagename or page title, got %s)", type(pagename)) end local content = page:getContent if not content then errorf("The page '%s' does not have any content.", pagename) end local params = for param_name in content:gmatch '