Module:SeasonVariables

From JoJo's Bizarre Encyclopedia - JoJo Wiki
Revision as of 07:11, 19 July 2023 by Vish (talk | contribs)
Jump to navigation Jump to search

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

local p = {}

function p.main(frame)
    local input = frame.args[1]
    local abbreviations = {
        PB = "Phantom Blood",
        BT = "Battle Tendency",
        SC = "Stardust Crusaders",
        DU = "Diamond is Unbreakable",
        GW = "Golden Wind",
        SO = "Stone Ocean",
        SBR = "Steel Ball Run",
        JJL = "JoJolion",
        TJL = "The JOJOLands"
    }
    for abbreviation, full_name in pairs(abbreviations) do
        if string.find(input, abbreviation) then
        	return "''[[" .. full_name .. "]]'' " .. string.sub(input, string.len(abbreviation) + 2)
        elseif string.find(input, "TSKR") then
        	return "''[[Thus Spoke Kishibe Rohan (OVA)|Thus Spoke Kishibe Rohan]]'' Episode " .. string.sub(input, string.len("TSKR Episode") + 2)
        elseif string.find(input, "(OVA)") then
        	return "''[[JoJo's Bizarre Adventure (OVA)]|JoJo's Bizarre Adventure]'' Episode " .. string.sub(input, string.len("Episode") + 2)
        end
    end
    return input
end

return p