Module:Numlinks: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
Line 1: Line 1:
-- Page is following provisonal style guide: User:Ganaram_inukshuk/Provisional_style_guide_for_Lua
-- Page is following provisonal style guide: User:Ganaram_inukshuk/Provisional_style_guide_for_Lua
local p = {}


local getArgs = require("Module:Arguments").getArgs
local ordinal = require("Module:Ordinal")._ordinal
local ordinal = require("Module:Ordinal")._ordinal
local getArgs = require("Module:Arguments").getArgs
local yesno = require("Module:Yesno")
local yesno = require("Module:yesno")
 
local p = {}


function p.numlinks_1_val(args)
function p.numlinks_1_val(args)
Line 85: Line 84:
end
end


-- Generate a table of previous and next links for numbered pages, with support
-- Main function
-- for up to two numbers. Args are as follows:
-- - Is ordinal: should the values be cardinal numbers (eg, 12edo) or ordinal
--  numbers (eg, 12th-octave)?
-- - Page text: Text is formatted as [pre-text][n][post-text], stored in a table
--  { pre } or { pre, post }. If the link config is for 8 links, then text is
--  formatted as [pre-text][n1][mid-text][n2][post-text], stored in a table
--  { mid, post } or { pre, mid, post }. Pre-text can be omitted since most
--  pages don't have pre-text (12edo, 5L 2s).
-- - Link text: Same as page text, except this changes the text of the link. If
--  this is not specified, then the page and link text are the same.
-- - Min: The smallest allowed value for a numbered link. Default is 1. There
--  isn't a maximum since these numbers are assumed to be either natural or
--  whole numbers.
function p._numlinks(frame)
function p._numlinks(frame)
local args = getArgs(frame)
local args = getArgs(frame)