Module:Numlinks: Difference between revisions

Ganaram inukshuk (talk | contribs)
No edit summary
Ganaram inukshuk (talk | contribs)
todo
Line 7: Line 7:


-- TODO:
-- TODO:
-- - Split into two modules: Numlinks and Numlinks-2D, since behaviors are too
-- - Refactor to use format strings instead of pretext-posttext
--   dissimilar to keep within one module


-- Main function
-- Main function
Line 14: Line 13:
local num_links  = args["Link Count"] or 1 -- Number of links to produce in each direction (left/prev and right/next)
local num_links  = args["Link Count"] or 1 -- Number of links to produce in each direction (left/prev and right/next)
local curr_num  = args["Num"] -- Current number
local curr_num  = args["Num"] -- Current number
local min_num    = args["Min"] or 1 -- Smallest allowed number
local min_num    = args["Min"] or 1 -- Smallest valid number
local link_text  = args["Link Text"] or { "", "" } -- Text for a link is "<pre-text><num><post-text>"
local link_text  = args["Link Text"] or { "", "" } -- Text for a link is "<pre-text><num><post-text>"
local disp_text  = args["Displayed Text"] or nil -- Option for if the text to display is different from the link (EG, "4L 5s <3/1>"" vs "4L 5s (3/1-equivalent)")
local disp_text  = args["Displayed Text"] or nil -- Option for if the text to display is different from the link (EG, "4L 5s <3/1>"" vs "4L 5s (3/1-equivalent)")