×
Create a new article
Write your page title here:
We currently have 1,396 articles on World Trigger Wiki. Type your article name above or create one of the articles listed here!



    World Trigger Wiki
    Content added Content deleted
    mNo edit summary
    mNo edit summary
     
    (One intermediate revision by the same user not shown)
    Line 3: Line 3:
    local function _resolve_pipe(text)
    local function _resolve_pipe(text)
    local func = text:gmatch("|.*")
    local func = text:gmatch("|.*")
    return func():sub(2) or text
    local data = func()
    if data ~= nil then return data:sub(2) else return text end
    end
    end


    Line 14: Line 15:
    return args, pargs
    return args, pargs
    end
    end

    local title = mw.title.getCurrentTitle()


    local mod = {
    local mod = {
    get_args_and_pargs = _get_args_and_pargs,
    get_args_and_pargs = _get_args_and_pargs,
    resolve_text = _resolve_pipe
    resolve_text = _resolve_pipe,
    FULLPAGENAME = title.prefixedText,
    PAGENAME = title.text
    }
    }


    function mod.resolve_pipe(frame)
    function mod.resolve_pipe(frame)
    local args, pargs = mod.get_args_and_pargs(frame)
    local args, pargs = mod.get_args_and_pargs(frame)
    local pipe = args[1] or pargs[1] or ""
    local pipe = args[1] or pargs[1] or "TBA"
    return mod.resolve_text(pipe)
    return mod.resolve_text(pipe)
    end
    end

    Latest revision as of 14:05, May 14, 2024

    Documentation for this module may be created at Module:Util/doc

    ---@param text string
    ---@return string
    local function _resolve_pipe(text)
        local func = text:gmatch("|.*")
        local data = func()
        if data ~= nil then return data:sub(2) else return text end
    end
    
    ---@return table, table
    local function _get_args_and_pargs(frame)
        local args = frame.args
        local parent = frame:getParent()
        local pargs={}
        if parent then pargs=parent.args end
        return args, pargs
    end
    
    local title = mw.title.getCurrentTitle()
    
    local mod = {
        get_args_and_pargs = _get_args_and_pargs,
        resolve_text = _resolve_pipe,
        FULLPAGENAME = title.prefixedText,
        PAGENAME = title.text
    }
    
    function mod.resolve_pipe(frame)
        local args, pargs = mod.get_args_and_pargs(frame)
        local pipe = args[1] or pargs[1] or "TBA"
        return mod.resolve_text(pipe)
    end
    
    return mod
    
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.

    Recent changes

  • Desk gun • 29 minutes ago
  • Desk gun • 34 minutes ago
  • Desk gun • 43 minutes ago
  • Desk gun • 43 minutes ago
  • Welcome to WorldTriggerWiki.com!

    We have completed moving the wiki here from FANDOM. This is the wiki that will be maintained and updated in the future (more information). Enjoy your stay!


    If you would like to get involved, or if you have questions or feedback, check out the Community Portal.

    Happy Birthday!

    July 3

    Rui Osano

    Cookies help us deliver our services. By using our services, you agree to our use of cookies.