Module:Luasubstring
Documentation for this module may be created at Module:Luasubstring/doc
-----------------------------------------------------------------------
-- Module Luasubstring - Get substring of 1 using Lua string.sub
-----------------------------------------------------------------------
local z = {
language = require "Module:Language",
fr = {
args = {}
}
}
function z.getParent()
return z.fr
end
-- This is used by template {{Lsubstr}}.
function z.substr(frame)
local pframe = frame:getParent()
local args = pframe.args -- arguments passed TO the template, in a page
local config = frame.args -- arguments passed BY the template
local pagename = config.pagename or ""
local namespace = config.namespace or ""
local str, str2
str = config.str
str2 = config.pagename
return str2
end