Module:Sandbox/Lord Farin

local p = {}

local priv = {} --Private functions function priv.isNull( arg ) return ( arg == nil or arg == "" ) end

--Public functions function p.definitionCategory( frame ) local tpl_args = frame:getParent.args local mwTitle = mw.title.getCurrentTitle local category = mwTitle.subpageText local tcNamespace if (priv.isNull( tpl_args.namespace )) then tcNamespace = "Definition" else tcNamespace = tpl_args.namespace end --[=[ defPage: Definition page link. def contains a ":"  " " def contains no ":" "Definition: " Default:            "Definition: " ]=] local defPage if (priv.isNull( tpl_args.def )) then defPage = "Definition:" .. category elseif ( string.match( tpl_args.def, ":" ) == nil ) then defPage = "Definition:" .. tpl_args.def else defPage = tpl_args.def end --[=[ defLinkWikitext: Display of page link disp exists: " " Default:     "" ]=] local defLinkWikitext = ""  if (priv.isNull( tpl_args.disp )) then    defLinkWikitext = defLinkWikitext .. defPage .. "" else defLinkWikitext = defLinkWikitext .. tpl_args.disp .. "]]" end local result = defLinkWikitext return result end

return p