Module:PartVariables

From JoJo's Bizarre Encyclopedia - JoJo Wiki
Revision as of 06:08, 19 July 2023 by Vish (talk | contribs) (Created page with "local p = {} function p.extractChapter(frame) local input = frame.args[1] local abbreviations = { PB = "Phantom Blood", BT = "Battle Tendency", SC = "Stardust Crusaders", DU = "Diamond is Unbreakable", VA = "Vento Aureo", SO = "Stone Ocean", SBR = "Steel Ball Run", JJL = "JoJolion", TJL = "The JOJOLands", TSKR = "Thus Spoke Kishibe Rohan", CDDH = "Crazy Diamond's Demonic Hear...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

local p = {}

function p.extractChapter(frame)
    local input = frame.args[1]
    local abbreviations = {
        PB = "Phantom Blood",
        BT = "Battle Tendency",
        SC = "Stardust Crusaders",
        DU = "Diamond is Unbreakable",
        VA = "Vento Aureo",
        SO = "Stone Ocean",
        SBR = "Steel Ball Run",
        JJL = "JoJolion",
        TJL = "The JOJOLands",
        TSKR = "Thus Spoke Kishibe Rohan",
        CDDH = "Crazy Diamond's Demonic Heartbreak",
        Baoh = "Baoh the Visitor",
        ["JORGE JOESTAR"] = "JORGE JOESTAR",
        CSBT = "Cool Shock B.T.",
        ["Cool Shock Old B.T."] = "Cool Shock Old B.T.",
        ["Gorgeous Irene"] = "Gorgeous Irene",
        Eccentrics = "The Lives of Eccentrics",
        ["Purple Haze Feedback"] = "Purple Haze Feedback",
        ["The Book"] = "The Book: JoJo's Bizarre Adventure 4th Another Day",
        ["Crazy Heartbreakers"] = "Crazy Heartbreakers",
        ["rey infinito"] = "rey infinito"
    }
    local abbreviation = abbreviations[string.sub(input, 1, 2)]
    if abbreviation then
        return "''[[" .. abbreviation .. "]]'' " .. string.sub(input, 3)
    else
        return input
    end
end

return p