Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:ObbyInfobox: Difference between revisions

From Obby Wiki
No edit summary
Tag: Reverted
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 5: Line 5:


local media = config_external.media
local media = config_external.media
local platforms = config_external.platforms


local function format_media(args)
local function format_media(args)
Line 11: Line 12:
     for i, v in pairs(media) do
     for i, v in pairs(media) do
         if args[i] then
         if args[i] then
             str = str .. ' ' .. (' [[File:' .. v.file .. '|28px|link=' .. v.url_form:format(args[v[1]]) .. ']]')
             str = str .. ' ' .. (' [[File:' .. v.file .. '|28px|link=' .. v.url_form:format(args[i]) .. '|alt="' .. v.display .. '"]]')
         end
         end
     end
     end


     return rs
     return str
end
 
local function format_platforms(args)
    local str = ''
 
    for i, v in pairs(platforms) do
        if args[i] then
            str = str .. ' ' .. (' [[File:' .. v.file .. '|28px|alt="Supports ' .. v.display .. '"]]')
        end
    end
 
    return str
end
end


return {
return {
     -- ['format_media'] = utils.wrap_function(format_media, true);
     ['format_media'] = utils.wrap_function(format_media, true);
     ['format_media'] = format_media;
     ['format_platforms'] = utils.wrap_function(format_platforms, true);
}
}

Latest revision as of 07:10, 4 April 2025

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

-- inspired by roblox.fandom.com

local utils = require('Module:Utils')
local config_external = require('Module:Config_external')

local media = config_external.media
local platforms = config_external.platforms

local function format_media(args)
    local str = ''

    for i, v in pairs(media) do
        if args[i] then
            str = str .. ' ' .. (' [[File:' .. v.file .. '|28px|link=' .. v.url_form:format(args[i]) .. '|alt="' .. v.display .. '"]]')
        end
    end

    return str
end

local function format_platforms(args)
    local str = ''

    for i, v in pairs(platforms) do
        if args[i] then
            str = str .. ' ' .. (' [[File:' .. v.file .. '|28px|alt="Supports ' .. v.display .. '"]]')
        end
    end

    return str
end

return {
    ['format_media'] = utils.wrap_function(format_media, true);
    ['format_platforms'] = utils.wrap_function(format_platforms, true);
}