Module:SemanticScribuntoTest

From EyeWiki

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

-- Module:SMW
local p = {}

-- set with direct return results
function p.info( frame )

    if not mw.smw then
        return "mw.smw module not found"
    end

    if frame.args[1] == nil then
        return "no parameter found"
    end

    local tooltip
    if frame.args[2] then
        tooltip = mw.smw.info( frame.args[1], frame.args[2] )
    else
        tooltip = mw.smw.info( frame.args[1] )
    end

    return tooltip
end
-- another example, info used inside another function
function p.inlineInfo( frame )

    local output = 'This is sample output'

    -- so some stuff

    output = output .. mw.smw.info( 'This is a warning', 'warning' )

    -- some more stuff

    return output
end

return p
The Academy uses cookies to analyze performance and provide relevant personalized content to users of our website.