Module:Infobox: Difference between revisions

Ganaram inukshuk (talk | contribs)
m forgot the lower links
Ganaram inukshuk (talk | contribs)
Module:Rank-n scale (not called "Infobox rank-n" so it slipped by me) still uses build-multilink, so added back function for that
Line 1: Line 1:
local getArgs = require("Module:Arguments").getArgs
local getArgs = require("Module:Arguments").getArgs
local p = {}
local p = {}
-- TODO
-- Drop support for link count as the presence/absence of entries 1-3 and 6-8 is
-- enough to add/omit rows.


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Line 202: Line 198:


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
------------------------------ EXISTING FUNCTIONS ------------------------------
------------------------------- LEGACY FUNCTIONS -------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


-- Original function; uses new functions but kept for legacy support of older
-- These functions are kept in the meantime to support older infoboxes and WILL
-- infoboxes.
-- be entirely deleted later! Please switch to the new functions!
 
-- Original function signature, kept for legacy support (for now).
function p.build(title, entries, prev_link, next_link)
function p.build(title, entries, prev_link, next_link)
local args = {
local args = {
["Adjacent Links"] = { (prev_link or ""), (next_link or "") },
["Adjacent Links"] = { (prev_link or ""), (next_link or "") },
["Title"] = title,
["Rows"] = entries,
}
return p._infobox(args)
end
-- Original 8-link function signature, pulled from infobox mos. (Literally only
-- one module left uses this: Rank-n scale, and it's confusingly not called
-- "Infobox rank-n"?)
function p.build_multilink(title, entries, adjacent_links)
local args = {
["Adjacent Links"] = adjacent_links,
["Title"] = title,
["Title"] = title,
["Rows"] = entries,
["Rows"] = entries,