Modul:Tools
Die Dokumentation für dieses Modul kann unter Modul:Tools/doc erstellt werden
local check = require('Modul:Check2') local function matchString ( stringStr, delimiterStr ) local s = stringStr..delimiterStr local words = {} for w in (s):gmatch('([^'..delimiterStr..']*)'..delimiterStr..'') do table.insert(words, w) end return words end local function rmNamespace ( pageName ) return matchString(pageName,':')[2] or pageName end local tools = {} function tools._getParameters( frame_args, arg_list ) local new_args = {}; local index = 1; local value; for i,arg in ipairs( arg_list ) do value = frame_args[arg] if value == nil then value = frame_args[index]; index = index + 1; end new_args[arg] = value; end return new_args; end function tools.firstBasepagename (frame) local new_args = tools._getParameters( frame.args, {'page'} ); local page = new_args['page'] or ''; -- return page return rmNamespace ( page ) -- return mw.ustring.gsub( rmNamespace ( page ), '(.-)/(.*)', '%1' ) end return tools