Content deleted Content added
fix English fail |
add an html_list function, and rename the randomize functions |
||
Line 1:
-- This module contains a number of functions that make use of random numbers.
local makeList = require('Module:List').makeList
local cfg = {}
Line 83 ⟶ 85:
end
function p.
-- Randomizes a list and concatenates the result with a separator.
local list = makeRandomList(args)
Line 90 ⟶ 92:
end
function p.
-- Randomizes a list and concatenates the result, text-style. Accepts separator and conjunction arguments.
local list = makeRandomList(args)
Line 96 ⟶ 98:
local conj = makeSeparator(args.conj or args.conjunction)
return mw.text.listToText(list, sep, conj)
end
function p._html_list(args)
-- Randomizes a list and turns it into an HTML list. Uses [[Module:List]].
local listArgs = makeRandomList(args) -- Arguments for [[Module:List]].
local listType = args.list_type or 'bulleted'
args.list_type = nil
for k, v in pairs(args) do
if type(k) == 'string' then
listArgs[k] = v
end
end
return makeList(listType, listArgs)
end
Line 126 ⟶ 141:
end
local funcNames = {'number', 'item', '
for _, funcName in ipairs(funcNames) do
p[funcName] = makeWrapper('_' .. funcName)
|