Module:Morganstedmanms

From JoJo's Bizarre Encyclopedia - JoJo Wiki
Jump to navigation Jump to search

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

local p = {}

function p.main(frame)
    local names = {
        "Kenichiro Aoki", "Ashima Astra", "Bengus", "Betten Court", "Nanae Chrono",
        "Omar Dogan", "Dowman Sayman", "Fairouz Ai", "Falcoon", "Fenyo_N",
        "Mille Feuille", "Butch Hartman", "Leslie Hung", "Ryo Imamura", "Hajime Isayama",
        "Aya Ito", "Tatsuro Iwamoto", "Masaaki Iwane", "K-Suwabe", "Kano Sisters",
        "Kohaku Kuroboshi", "Stanley \"Artgerm\" Lau", "Dragon Garow Lee", "Kei Mizuryu",
        "Atsushi Nakayama", "Namori", "Asako Nishida", "Kazuya Nuri", "Bkub Okawa",
        "Sakura", "Kaho Shibuya", "Kou Takasugi", "Tana-Taka", "Tiv", "Mamoru Yokota",
        "Akiho Yoshizawa", "Megan Thee Stallion", "Miscellaneous"
    }

    local function extractLastName(fullName)
        local lastName = fullName:match("%S+$")
        return lastName
    end

    table.sort(names, function(a, b)
        return extractLastName(a) < extractLastName(b)
    end)

    local output = ""
    for i, name in ipairs(names) do
        output = output .. "{{AnchorButton|" .. name .. "}}"
    end

    return frame:preprocess(output)
end

return p