Module:Infobox gridiron football person/convert explained

-- [SublimeLinter luacheck-globals:mw]

-- This module serves to convert
-delimited teams/years parameters in-- to their equivalent numbered pairs. Simply-- replace "

Main&Quot; And Press &Quot;Save&Quot;. Local P:local getBuffer, print = require("Module:OutputBuffer")

local function printfd(formatString, ...) local default = ""

local args, argsNum =, select("#", ...) local newArgs = for i = 1, argsNum do if args[i] ~= nil then table.insert(newArgs, args[i]) else table.insert(newArgs, default) end end print(string.format(formatString, unpack(newArgs)))end

local function processTeamsYears(prefix, teams, years) local function extractItems(s, t) local sentinel = "" -- WTF, Lua? string.gsub(string.gsub(s, "<[Bb][Rr] */?>", " " .. sentinel .. " "), "[^" .. sentinel .. "]+", function(c) table.insert(t, string.match(c, "^%s*(.-)%s*$")) end) end local newTeams = extractItems(teams, newTeams) local newYears = extractItems(years, newYears)

if #newTeams ~= #newYears then printfd("", prefix, prefix) printfd("

%S Teams:%s", prefix, teams) printfd("
%S Years:%s", prefix, years) return end

c = 1 for i = 1, #newTeams do if newYears[i] ~= "" or newTeams[i] ~= "" then printfd("

%S Years%S:%s", prefix, c, newYears[i] ~= "" and newYears[i] or "") printfd("
%S Team%S:%s", prefix, c, newTeams[i] ~= "" and newTeams[i] or "") c = c + 1 end endend

function p._main(args) print("

Embed:%s", args.embed) end printfd("
%s", args.name) printfd("
Image Upright:%s", args.image_upright) end printfd("
Nickname:%s", args.nickname) end printfd("
Birth Date:%s", args.birth_date) printfd("
Birth Place:%s", args.birth_place) printfd("
Death Date:%s", args.death_date) printfd("
Death Place:%s", args.death_place) printfd("
Team:%s", args.team) printfd("
Number:%s", args.number) printfd("
Status:%s", args.status) if args.import then printfd("
Import:%s", args.import) end printfd("
Position1:%s", args.position1 or args.position or args.Position) if args.position2 then printfd("
Position2:%s", args.position2) end if args.position3 then printfd("
Position3:%s", args.position3) end if args.position4 then printfd("
Position4:%s", args.position4) end if args.position5 then printfd("
Position5:%s", args.position5) end if args.uniform_number or args.jersey then printfd("
Uniform Number:%s", args.uniform_number or args.jersey) end printfd("
Height Ft:%s", args.height_ft or args.Height_ft) printfd("
Height In:%s", args.height_in or args.Height_in) printfd("
Weight Lb:%s", args.weight_lb or args.weight_lbs or args.Weight_lb or args.Weight_lbs) if args.college or args.College then printfd("
College:%s", args.college or args.College) end if args.CIS then printfd("
Cis:%s", args.CIS) end if args.amateur_title or args.amateur_team then printfd("
Amateur Title:%s", args.amateur_title) printfd("
Amateur Team:%s", args.amateur_team) end if args.high_school then printfd("
High School:%s", args.high_school) end if args.AFLRookieYear then printfd("
Aflrookieyear:%s", args.AFLRookieYear) end if args.AFLDraftedYear or args.AFLDraftedRound or args.AFLDraftedPick or args.AFLDraftedTeam then printfd("
Afldraftedyear:%s", args.AFLDraftedYear) printfd("
Afldraftedround:%s", args.AFLDraftedRound) printfd("
Afldraftedpick:%s", args.AFLDraftedPick) printfd("
Afldraftedteam:%s", args.AFLDraftedTeam) end if args.BAFLRookieYear or args.BAFLDraftedTeam then printfd("
Baflrookieyear:%s", args.BAFLRookieYear) printfd("
Bafldraftedteam:%s", args.BAFLDraftedTeam) end if args.CFLDraftedYear or args.CFLDraftedRound or args.CFLDraftedPick or args.CFLDraftedTeam then printfd("
Cfldraftedyear:%s", args.CFLDraftedYear) printfd("
Cfldraftedround:%s", args.CFLDraftedRound) printfd("
Cfldraftedpick:%s", args.CFLDraftedPick) printfd("
Cfldraftedteam:%s", args.CFLDraftedTeam) end if args.CommonDraftedYear or args.CommonDraftedRound or args.CommonDraftedPick or args.CommonDraftedTeam then printfd("
Commondraftedyear:%s", args.CommonDraftedYear) printfd("
Commondraftedround:%s", args.CommonDraftedRound) printfd("
Commondraftedpick:%s", args.CommonDraftedPick) printfd("
Commondraftedteam:%s", args.CommonDraftedTeam) end if args.ExpDraftedYear or args.ExpDraftedRound or args.ExpDraftedPick or args.ExpDraftedTeam then printfd("
Expdraftedyear:%s", args.ExpDraftedYear) printfd("
Expdraftedround:%s", args.ExpDraftedRound) printfd("
Expdraftedpick:%s", args.ExpDraftedPick) printfd("
Expdraftedteam:%s", args.ExpDraftedTeam) end if args.NFLDraftedYear or args.NFLDraftedRound or args.NFLDraftedPick or args.NFLDraftedTeam or args.DraftedYear or args.DraftedRound or args.DraftedPick then printfd("
Nfldraftedyear:%s", args.NFLDraftedYear or args.DraftedYear) printfd("
Nfldraftedround:%s", args.NFLDraftedRound or args.DraftedRound) printfd("
Nfldraftedpick:%s", args.NFLDraftedPick or args.DraftedPick) printfd("
Nfldraftedteam:%s", args.NFLDraftedTeam) end if args.NFLSuppDraftedYear or args.NFLSuppDraftedRound or args.NFLSuppDraftedPick then printfd("
Nflsuppdraftedyear:%s", args.NFLSuppDraftedYear) printfd("
Nflsuppdraftedround:%s", args.NFLSuppDraftedRound) printfd("
Nflsuppdraftedpick:%s", args.NFLSuppDraftedPick) end if args.hand then printfd("
Hand:%s", args.hand) end if args.pass_style then printfd("
Pass Style:%s", args.pass_style) end if args.administrating_teams and args.administrating_years then processTeamsYears("administrating", args.administrating_teams, args.administrating_years) elseif args.administrating_teams then print("") printfd("
Administrating Teams:%s", args.administrating_teams) print("
Administrating Years:") elseif args.administrating_years then print("") print("
Administrating Teams:") printfd("
Administrating Years:%s", args.administrating_years) end if args.coaching_teams and args.coaching_years then processTeamsYears("coaching", args.coaching_teams, args.coaching_years) elseif args.coaching_teams then print("") printfd("
Coaching Teams:%s", args.coaching_teams) print("
Coaching Years:") elseif args.coaching_years then print("") print("
Coaching Teams:") printfd("
Coaching Years:%s", args.coaching_years) end if args.playing_teams and args.playing_years or args.teams and args.years then processTeamsYears("playing", args.playing_teams or args.teams, args.playing_years or args.years) elseif args.playing_teams or args.teams then print("") printfd("
Playing Teams:%s", args.playing_teams or args.teams) print("
Playing Years:") elseif args.playing_years or args.years then print("") print("
Playing Teams:") printfd("
Playing Years:%s", args.playing_years or args.years) end if args.other_teams and args.other_years then printfd("
Other Title:%s", args.other_title) processTeamsYears("other", args.other_teams, args.other_years) elseif args.other_teams then print("") printfd("
Other Title:%s", args.other_title) printfd("
Other Teams:%s", args.other_teams) print("
Other Years:") elseif args.other_years then print("") printfd("
Other Title:%s", args.other_title) print("
Other Teams:") printfd("
Other Years:%s", args.other_years) end if args.career_footnotes then printfd("
Career Footnotes:%s", args.career_footnotes) end printfd("
Career Highlights:%s", args.career_highlights) if args.AFLAllStar then printfd("
Aflallstar:%s", args.AFLAllStar) end if args.CFLAllStar then printfd("
Cflallstar:%s", args.CFLAllStar) end if args.CFLEastAllStar then printfd("
Cfleastallstar:%s", args.CFLEastAllStar) end if args.CFLWestAllStar then printfd("
Cflwestallstar:%s", args.CFLWestAllStar) end if args.ProBowls then printfd("
Probowls:%s", args.ProBowls) end if args.awards or args.Awards then printfd("
Awards:%s", args.awards or args.Awards) end if args.honors or args.Honors then printfd("
Honors:%s", args.honors or args.Honors) elseif args.honours or args.Honours then printfd("
Honours:%s", args.honours or args.Honours) end if args["retired #s"] or args["Retired #s"] then printfd("
Awards:%s", args["retired #s"] or args["Retired #s"]) end if args.records or args.Records then printfd("
Records:%s", args.records or args.Records) end if args.statlabel1 or args.statvalue1 then printfd("
Statlabel1:%s", args.statlabel1) printfd("
Statvalue1:%s", args.statvalue1) printfd("
Statlabel2:%s", args.statlabel2) printfd("
Statvalue2:%s", args.statvalue2) printfd("
Statlabel3:%s", args.statlabel3) printfd("
Statvalue3:%s", args.statvalue3) printfd("
Statlabel4:%s", args.statlabel4) printfd("
Statvalue4:%s", args.statvalue4) printfd("
Statlabel5:%s", args.statlabel5) printfd("
Statvalue5:%s", args.statvalue5) end if args.AFL then printfd("
Afl:%s", args.AFL) end if args.ArenaFan then printfd("
Arenafan:%s", args.ArenaFan) end if args.CFL then printfd("
Cfl:%s", args.CFL) end if args.NFL then printfd("
Nfl:%s", args.NFL) end if args.CBS then printfd("
Cbs:%s", args.CBS) end if args.DatabaseFootball then printfd("
Databasefootball:%s", args.DatabaseFootball) end if args.CoachPFR then printfd("
Coachpfr:%s", args.CoachPFR) end if args.CFHOF then printfd("
Cfhof:%s", args.CFHOF) end if args.CFHOFYear then printfd("
Cfhofyear:%s", args.CFHOFYear) end if args.CollegeHOF then printfd("
Collegehof:%s", args.CollegeHOF) end if args.CollegeHOFYear then printfd("
Collegehofyear:%s", args.CollegeHOFYear) end if args.PFHOF or args.HOF then printfd("
Pfhof:%s", args.PFHOF or args.HOF) end if args.PFHOFYear or args.HOFYear then printfd("
Pfhofyear:%s", args.PFHOFYear or args.HOFYear) end if args.module then printfd("
Module:%s", args.module) end print("

")

return getBuffer("\n")end

function p.main(frame) local args = require("Module:Arguments").getArgs(frame) return p._main(args)end

return p