Module:Keyword

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

local getArgs = require('Module:Arguments').getArgs
local p = {}
local root

function p.main(frame)
    local args = getArgs(frame, { parentOnly = true })
    return p._main(args)
end

function p._main(args)
    local config = mw.loadJsonData( 'Module:Keyword/config.json' )

    root = mw.html.create('span')
    root
            :css('color', config[string.lower(args[1])] or 'inherit')
            :wikitext( args[1] )

    return tostring(root)
end

return p