Dokumentasion ti modulo

Daytoy a modulo ket aglaon kadagiti bilang ti annong nga agus-usar kadagiti pugto a bilang. Daytoy ket mabalin a mangiparuar kadagiti pugto a bilang, agpili ti pugto a banag manipud ti maysa a listaan, ken pugtuenna nga urnosen manen ti listaan. Ti napugtuan a naurnos manen a listaan ket mabalin a maiparuar a nailinia, wenno dagiti nadumaduma a kita ti naurnos ken di naurnos a listaan. Dagiti mabalin a magun-od nga annong ket naipakpakita iti ad-adu a panangipalpalawag dita baba.

Bilang urnosen

Ti annong ti number ket mangiparuar ti pugto a bilang.

{{#invoke:pugto|number|m|n|same=yes}}

Dagiti argumento ti m ken n ket mabalin a saan nga iraman, ngem no mainaganan daytoy ket nasken a dagiti mabalin a sibubukel a bilang.

  • No awan dagiti argumento, mangisubli ti pudno a bilang iti sakop ti .
  • No adda ti maysa nga argumento, mangisubli ti maysa a sibubukel a bilang iti sakop ti . Ti m ket nasken a positibo.
  • No adda dagiti dua nga argumento, mangisubli ti maysa a sibubukel a bilang iti sakop ti . Ti m ken n ket mabalin a positibo wenno negatibo. No ti m ket dakdakkel ngem n, imbes ket a mangisubli daytoy ti maysa a sibubukel a bilang iti sakop ti .
  • No ti parametro ti |same= ket maiyasentar iti "yes", "y", "true", or "1", ti isu met laeng a pugto a bilang ket maisubli para iti tunggal maysa a panagtawag ti modulo a naited iti maysa a panid.

Dagiti kas pagarigan (purgaen)

  • {{#invoke:pugto|number}} → 0.65465996072379
  • {{#invoke:pugto|number|100}} → 86
  • {{#invoke:pugto|number|-100|-50}} → -89
  • {{#invoke:pugto|number|100|same=yes}} → 80
  • {{#invoke:pugto|number|100|same=yes}} → 80

Ti dokumentasion daytoy nga annong ket sangkapaset a naala manipud ti reperensia a manual ti Scribunto Lua, a naibatay met iti Reperensia a Manual ti Lua 5.1, a mabalin a magun-od babaen ti MIT a Lisensia.

Petsa urnosen

Ti annong ti date ket mangiparuar ti pugto a petsa.

{{#invoke:pugto|date|timestamp1|timestamp2|format=pormat ti petsa|same=yes}}
  • No awan dagiti argumento ti petsa a mainaganan, ti modulo ket mangparuar ti pugto a petsa iti agdama tawen.
  • No mainaganan ti timestamp1 ken ti timestamp2, ti modulo ket mangparuar ti pugto a petsa a nagbaetan dagitoy dua a petsa. Ti timestamp1 ket nasken a nasapsapa ngem ti timestamp2.
  • No ti laeng mainaganan ket ti timestamp1 , ti modulo ket mangiparuar ti pugto a petsa a nagbaetan ti Unix epoch (1 Jan 1970) ken ti petsa. Ti timestamp1 ket nasken a saan a nasapsapa ngem 1 Jan 1970.
  • Ti panagporma ket mabalin a mainaganan babaen ti parametro ti |format=. Ti kasisigud a pangporma ket "hh:mm, DD Month YYYY (UTC)" (kapada ti kasisigud a petsa ti Wikipedia).
  • Ti petsa ken ti parametro ti |format= ket mangawat kadagiti pateg a maitunos iti parser nga annong ti #time. Pangngaasi a kitaen ti dokumentasion ti #time para kadagiti napno a sakop dagiti mabalin a maikabil a pateg ken dagiti pagpilian a panagporma.
  • No ti parametro ti |same= ket maiyasentar iti "yes", "y", "true", wenno "1", ti isu met laeng a petsa ti maisubli para iti tunggal maysa a panagtawag ti modulo ti naited iti maysa a panid.

Dagiti kas pagarigan (purgaen)

  • {{#invoke:pugto|date}} → 20:35, 16 Septiembre 2024 (UTC)
  • {{#invoke:pugto|date|format=F j}} → Mayo 7
  • {{#invoke:pugto|date|1 Jan 1980|31 Dec 1999}} → 16:49, 03 Pebrero 1985 (UTC)
  • {{#invoke:pugto|date|1st January 1500|1st January 3000|format=g:i a, l d M Y}} → 8:27 pm, Huebes 04 Nob 1999
  • {{#invoke:pugto|date|1970/06/01}} → 07:07, 24 Mayo 1970 (UTC)
  • {{#invoke:pugto|date|same=yes}} → 17:04, 18 Oktubre 2024 (UTC)
  • {{#invoke:rpugto|date|same=yes}} → 17:04, 18 Oktubre 2024 (UTC)

Banag urnosen

Ti annong ti item ket mangiparuar ti pugto a banag manipud ti listaan.

{{#invoke:pugto|item|listaan ti banag 1|listaan ti banag 2|listaan ti banag 3|...|same=yes}}

No ti parametro ti |same= ket maiyasentar iti "yes", "y", "true", wenno "1", ti isu met laeng a banag ket maisubli para iti tunggal maysa a panagtawag ti modulo ti naited iti maysa a panid.

Dagiti kaspagarigan (purgaen)

  • {{#invoke:pugto|item|egg|beans|sausage|bacon|spam}} → sausage
  • {{#invoke:pugto|item|egg|beans|sausage|bacon|spam|same=yes}} → spam
  • {{#invoke:pugto|item|egg|beans|sausage|bacon|spam|same=yes}} → spam

Listaan urnosen

Ti annong ti list ket mangiparuar ti listaan iti pugto nga urnos.

{{#invoke:pugto|list|listaan ti banag 1|lisaan ti banag 2|listaan ti banag 3|...|sep=separator|limit=bilang ti banbanag a maiparang|same=yes}}

Dagiti nainaganan a parametro

  • |sep= wenno |separator= - ti maysa a pagpilian a panangisina para iti listaan ti banbanag. Adda met dagiti pateg a naipangpangruna; kitaen ti tabla dita baba.
  • |limit= - ti kaaduan a bilang a maiparang iti listaan ti banbanag. Ti kababaan a mabalin ket 0 ken ti kangatuan a mabalin ket ti kaatiddog ti listaan.
  • |same= - no daytoy ket maiyasentar iti "yes", "y", "true", wenno "1", ti urnos ti listaan ket isu met laeng para iti tunggal maysa a panagtawag ti modulo a naited iti maysa a panid.
Dagiti mabalin a pateg ti panagilasin
Kodigo Maiparuar
dot  ·
pipe |
comma ,
tpt-languages ⧼tpt-languages-separator⧽
space baetan
aniaman a sabali a pateg dadduma pay a pateg ket mausar nga awan ti panagbalbaliw

Saan a mabalin ti dagus a panagikabil dagiti baetan iti parametro ti |sep= gapu kadagiti limitasion ti eskritu ti plantilia ti MediaWiki. Nupay kasta, mabalin daytoy babaen ti panagusar kadagiti entidad ti HTML. Mabalin ti agusar ti   tapno mairepresenta ti kadawyan a baetan, ken ti   tapno mangirepresenta ti di matukkol a baetan.

Dagiti kas pagarigan (purgaen)

  • {{#invoke:pugto|list|egg|beans|sausage|bacon|spam}} → beanssausagebaconeggspam
  • {{#invoke:pugto|list|egg|beans|sausage|bacon|spam|sep=dot}} → sausage · spam · bacon · egg · beans
  • {{#invoke:pugto|list|egg|beans|sausage|bacon|spam|sep=space}} → sausage spam egg bacon beans
  • {{#invoke:pugto|list|egg|beans|sausage|bacon|spam|sep=; }} → bacon; beans; spam; sausage; egg
  • {{#invoke:pugto|list|egg|beans|sausage|bacon|spam|sep=foo}} → spamfoobeansfooeggfoobaconfoosausage
  • {{#invoke:pugto|list|egg|beans|sausage|bacon|spam|limit=3}} → sausagespamegg
  • {{#invoke:pugto|list|egg|beans|sausage|bacon|spam|same=yes}} → beanssausageeggbaconspam
  • {{#invoke:pugto|list|egg|beans|sausage|bacon|spam|same=yes}} → beanssausageeggbaconspam

Listaan ti teksto urnosen

Ti annong ti text_list ket mangiparuar ti listaan iti pugto nga urnos, nga estilo ti teksto. Iti sabali pay a panangibaga, daytoy ket kasla iti annong ti list , ngem adda ti sabali a panangisina sakbay ti maudi a banag.

{{#invoke:pugto|text_list|listaan ti banag 1|listaan ti banag 2|listaan ti banag 3|...|sep=separator|conj=conjunction|limit=bilang ti banbanag a maiparang|same=yes}}

Ti panangisina ket mabalin a mainaganan kadagiti parametro ti |sep= wenno |separator= ; ti kasisigud a pateg ket ti ", ". Ti conjunction ket mabalin a mainaganan babaen dagiti parametro ti |conj= wenno |conjunction= ; ti kasisigud a pateg ket " ken ". Ti panangisina ken ti conjunction ket mabalin a mainaganan kadagiti isu met laeng a pateg kasla ti panangisina iti annong ti listaan.

Ti kaadu a maiparang a bilang ti banbanag ti listaan ket mabalin a maiyasentar iti parametro ti |limit= . Ti kabassitan a mabalin ket 0 ken ti kangatuan a mabalin ket ti kaatiddog ti listaan.

No ti parametro ti |same= ket maiyasentar iti "yes", "y", "true", wenno "1", ti urnos ti listaan ket isu met laeng para iti tunggal maysa a panagtawag ti modulo iti naited a panid.

Dagiti kas pagarigan (purgaen)

  • {{#invoke:pugto|text_list|egg|beans|sausage|bacon|spam}} → beans, egg, spam, bacon ken sausage
  • {{#invoke:pugto|text_list|egg|beans|sausage|bacon|spam|sep=; }} → beans; bacon; egg; spam ken sausage
  • {{#invoke:pugto|text_list|egg|beans|sausage|bacon|spam|sep=; |conj= or }} → sausage; egg; bacon; spam or beans
  • {{#invoke:pugto|text_list|egg|beans|sausage|bacon|spam|limit=3}} → sausage, bacon ken beans
  • {{#invoke:pugto|text_list|egg|beans|sausage|bacon|spam|same=yes}} → beans, sausage, egg, bacon ken spam
  • {{#invoke:pugto|text_list|egg|beans|sausage|bacon|spam|same=yes}} → beans, sausage, egg, bacon ken spam

Listaan ti HTML urnosen

No kayat ti mangiparuar ti listaan ti HTML iti pugto nga urnos, mabali ti agpili iti baetan dagiti nadumaduma nga annong: bulleted_list, unbulleted_list, horizontal_list, ordered_list, ken horizontal_ordered_list. Dagitoy amin nga annong ket agusarda ti Modulo:Listaan.

Nagan ti annong Mapataud Kaspagarigan a kodigo Kas pagarigan a maiparuar (purgaen)
bulleted_list Dagiti napungluan a listaan {{#invoke:pugto|bulleted_list|egg|sausage|spam}}
  • egg
  • sausage
  • spam
unbulleted_list Dagiti di napungluan a listaan {{#invoke:pugto|unbulleted_list|egg|sausage|spam}}
  • sausage
  • egg
  • spam
horizontal_list Dagiti horisontal a napungluan a listaan {{#invoke:pugto|horizontal_list|egg|sausage|spam}}
  • sausage
  • spam
  • egg
ordered_list Dagiti naurnos a listaan (nabilangan alistaan ken alpabetikal a listaan) {{#invoke:pugto|ordered_list|egg|sausage|spam}}
  1. egg
  2. sausage
  3. spam
horizontal_ordered_list Dagiti horisontal a naurnos a listaan {{#invoke:pugto|horizontal_ordered_list|egg|sausage|spam}}
  1. spam
  2. sausage
  3. egg
Batayan a panagusar
{{#invoke:pugto|annong|listaan ti banag 1|listaan ti banag 2|listaan ti banag 3|...|limit=bilang ti banbanag a maiparang|same=yes}}
Dagiti amin a parametro
{{#invoke:pugto|annong
|umuna a banag|maikadua a banag|maikatlo a banag|...
|start           = rugi a bilang para iti naurnos a listaan
|type            = kita ti panagmarka para iti naurnos a listaan
|list_style_type = kita ti panagmarka para iti naurnos a listaan (agusar ti CSS)
|class           = Klase
|style           = estilo
|list_style      = estilo para iti listaan
|item_style      = estilo para iti amin a banbanag ti listaan
|item_style1     = estilo para iti umuna a banag ti listaan |item_style2 = estilo para iti maikadua a banag ti listaan |...
|indent          = lennek para iti horisontal a listaan
}}

Ti kaadu ti bilang ti listaan ti banbanag a maiparang ket maiyasentar babaen ti parametro ti |limit=. Ti kabassitan a mabalin ket 0 ken ti mabalin a kangatuan ket ti kaatiddog ti listaan.

No ti parametro ti |same= ket maiyasentar iti "yes", "y", "true", wenno "1", ti urnos ti listaan ket kapada met laeng para iti tunggal maysa a panagtawag ti modulo iti naited ti maysa a panid.

Pangngaasi a kitaen ti Modulo:Listaan para kadagit iamin a panangipalawag kadagiti dadduma a parametro.

-- Daytoy a modulo ket aglaon kadagiti annong nga agusar kadagiti pugto a bilang.

local cfg = {}

--------------------------------------------------------------------------------------
-- Configuration
--------------------------------------------------------------------------------------

-- Set this to true if your wiki has a traffic rate of less than one edit every two minutes or so.
-- This will prevent the same "random" number being generated many times in a row until a new edit is made
-- to the wiki. This setting is only relevant if the |same= parameter is set.
cfg.lowTraffic = true

-- If cfg.lowTraffic is set to true, and the |same= parameter is set, this value is used for the refresh rate of the random seed.
-- This is the number of seconds until the seed is changed. Getting this right is tricky. If you set it too high, the same number
-- will be returned many times in a row. If you set it too low, you may get different random numbers appearing on the same page,
-- particularly for pages that take many seconds to process.
cfg.seedRefreshRate = 60

--------------------------------------------------------------------------------------
-- End configuration
--------------------------------------------------------------------------------------

local p = {} -- For functions available from other Lua modules.
local l = {} -- For functions not available from other Lua modules, but that need to be accessed using table keys.

local yesno = require('Modulo:Wensaan')
local makeList = require('Modulo:Listaan').makeList

--------------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------------

local function raiseError(msg)
	-- This helps to generate a wikitext error. It is the calling function's responsibility as to how to include it in the output.
	return mw.ustring.format('<b class="error">Biddut ti [[Modulo:Pugto]]: %s.</b>', msg)
end

--------------------------------------------------------------------------------------
-- random number function
--------------------------------------------------------------------------------------

local function getBigRandom(l, u)
	-- Gets a random integer between l and u, and is not limited to RAND_MAX.
	local r = 0
	local n = 2^math.random(30) -- Any power of 2.
	local limit = math.ceil(53 / (math.log(n) / math.log(2)))
	for i = 1, limit do
		r = r + math.random(0, n - 1) / (n^i)
	end
	return math.floor(r * (u - l + 1)) + l
end

function l.number(args)
	-- Gets a random number.
	first = tonumber(args[1])
	second = tonumber(args[2])
	-- This needs to use if statements as math.random won't accept explicit nil values as arguments.
	if first then
		if second then
			if first > second then -- Second number cannot be less than the first, or it causes an error.
				first, second = second, first
			end
			return getBigRandom(first, second)
		else
			return getBigRandom(1, first)
		end
	else
		return math.random()
	end
end

--------------------------------------------------------------------------------------
-- Date function
--------------------------------------------------------------------------------------

function l.date(args)
	-- This function gets random dates, and takes timestamps as positional arguments.
	-- With no arguments specified, it outputs a random date in the current year.
	-- With two arguments specified, it outputs a random date between the timestamps.
	-- With one argument specified, the date is a random date between the unix epoch (1 Jan 1970) and the timestamp.
	-- The output can be formatted using the "format" argument, which works in the same way as the #time parser function.
	-- The default format is the standard Wikipedia timestamp.
	local lang = mw.language.getContentLanguage()

	local function getDate(format, ts)
		local success, date = pcall(lang.formatDate, lang, format, ts)
		if success then
			return date
		end
	end

	local function getUnixTimestamp(ts)
		local unixts = getDate('U', ts)
		if unixts then
			return tonumber(unixts)
		end
	end

	local t1 = args[1]
	local t2 = args[2]
	
	-- Find the start timestamp and the end timestamp.
	local startTimestamp, endTimestamp
	if not t1 then
		-- Find the first and last second in the current year.
		local currentYear = tonumber(getDate('Y'))
		local currentYearStartUnix = tonumber(getUnixTimestamp('1 Jan ' .. tostring(currentYear)))
		local currentYearEndUnix = tonumber(getUnixTimestamp('1 Jan ' .. tostring(currentYear + 1))) - 1
		startTimestamp = '@' .. tostring(currentYearStartUnix) -- @ is used to denote Unix timestamps with lang:formatDate.
		endTimestamp = '@' .. tostring(currentYearEndUnix)
	elseif t1 and not t2 then
		startTimestamp = '@0' -- the Unix epoch, 1 January 1970
		endTimestamp = t1
	elseif t1 and t2 then
		startTimestamp = t1
		endTimestamp = t2
	end

	-- Get Unix timestamps and return errors for bad input (or for bugs in the underlying PHP library, of which there are unfortunately a few)
	local startTimestampUnix = getUnixTimestamp(startTimestamp)
	local endTimestampUnix = getUnixTimestamp(endTimestamp)
	if not startTimestampUnix then
		return raiseError('"' .. tostring(startTimestamp) .. '" ket saan a nabigbibgan a kas umiso a petsa')
	elseif not endTimestampUnix then
		return raiseError('"' .. tostring(endTimestamp) .. '" ket saan a nabigbibgan a kas umiso a petsa')
	elseif startTimestampUnix > endTimestampUnix then
		return raiseError('ti rugi ti petsa ket nasken a saan a naladladaw ngem ti gibus ti petsa (rugi ti petsa: "' .. startTimestamp .. '", gibus ti petsa: "' .. endTimestamp .. '")')
	end

	-- Get a random number between the two Unix timestamps and return it using the specified format.
	local randomTimestamp = getBigRandom(startTimestampUnix, endTimestampUnix)
	local dateFormat = args.format or 'H:i, d F Y (T)'
	local result = getDate(dateFormat, '@' .. tostring(randomTimestamp))
	if result then
		return result
	else
		return raiseError('"' .. dateFormat .. '" ket saan a husto a pormat ti petsa')
	end
end

--------------------------------------------------------------------------------------
-- List functions
--------------------------------------------------------------------------------------

local function randomizeArray(t, limit)
	-- Randomizes an array. It works by iterating through the list backwards, each time swapping the entry
	-- "i" with a random entry. Courtesy of Xinhuan at http://forums.wowace.com/showthread.php?p=279756
	-- If the limit parameter is set, the array is shortened to that many elements after being randomized.
	-- The lowest possible value is 0, and the highest possible is the length of the array.
	local len = #t
	for i = len, 2, -1 do
		local r = math.random(i)
		t[i], t[r] = t[r], t[i]
	end
	if limit and limit < len then
		local ret = {}
		for i, v in ipairs(t) do
			if i > limit then
				break
			end
			ret[i] = v
		end
		return ret
	else
		return t
	end
end

local function removeBlanks(t)
	-- Removes blank entries from an array so that it can be used with ipairs.
	local ret = {}
	for k, v in pairs(t) do
		if type(k) == 'number' then
			table.insert(ret, k)
		end
	end
	table.sort(ret)
	for i, v in ipairs(ret) do
		ret[i] = t[v]
	end
	return ret
end

local function makeSeparator(sep)
	if sep == 'space' then
		-- Include an easy way to use spaces as separators.
		return ' '
	elseif sep == 'newline' then
		-- Ditto for newlines
		return '\n'
	elseif type(sep) == 'string' then
		-- If the separator is a recognised MediaWiki separator, use that. Otherwise use the value of sep if it is a string.
		local mwseparators = {'dot', 'pipe', 'comma', 'tpt-languages'}
		for _, mwsep in ipairs(mwseparators) do
			if sep == mwsep then
				return mw.message.new( sep .. '-separator' ):plain()
			end
		end
		return sep
	end
end

local function makeRandomList(args)
	local list = removeBlanks(args)
	list = randomizeArray(list, tonumber(args.limit))
	return list
end

function l.item(args)
	-- Returns a random item from a numbered list.
	local list = removeBlanks(args)
	local len = #list
	if len >= 1 then
		return list[math.random(len)]
	end
end

function l.list(args)
	-- Randomizes a list and concatenates the result with a separator.
	local list = makeRandomList(args)
	local sep = makeSeparator(args.sep or args.separator)
	return table.concat(list, sep)
end

function l.text_list(args)
	-- Randomizes a list and concatenates the result, text-style. Accepts separator and conjunction arguments.
	local list = makeRandomList(args)
	local sep = makeSeparator(args.sep or args.separator)
	local conj = makeSeparator(args.conj or args.conjunction)
	return mw.text.listToText(list, sep, conj)
end

function l.array(args)
	-- Returns a Lua array, randomized. For use from other Lua modules.
	return randomizeArray(args.t, args.limit)
end

--------------------------------------------------------------------------------------
-- HTML list function
--------------------------------------------------------------------------------------

function l.html_list(args, listType)
	-- Randomizes a list and turns it into an HTML list. Uses [[Modulo:Listaan]].
	listType = listType or 'bulleted'
	local listArgs = makeRandomList(args) -- Arguments for [[Modulo:Listaan]].
	for k, v in pairs(args) do
		if type(k) == 'string' then
			listArgs[k] = v
		end
	end
	return makeList(listType, listArgs)
end

--------------------------------------------------------------------------------------
-- The main function. Called from other Lua modules.
--------------------------------------------------------------------------------------

function p.main(funcName, args, listType)
	-- Sets the seed for the random number generator and passes control over to the other functions.
	local same = yesno(args.same)
	if not same then
		-- Generates a different number every time the module is called, even from the same page.
		-- This is because of the variability of os.clock (the time in seconds that the Lua script has been running for).
		math.randomseed(mw.site.stats.edits + mw.site.stats.pages + os.time() + math.floor(os.clock() * 1000000000))
	else
		if not cfg.lowTraffic then
			-- Make the seed as random as possible without using anything time-based. This means that the same random number
			-- will be generated for the same input from the same page - necessary behaviour for some wikicode templates that
			-- assume bad pseudo-random-number generation.
			local stats = mw.site.stats
			local views = stats.views or 0 -- This is not always available, so we need a backup.
			local seed = views + stats.pages + stats.articles + stats.files + stats.edits + stats.users + stats.activeUsers + stats.admins -- Make this as random as possible without using os.time() or os.clock()
			math.randomseed(seed)
		else
			-- Make the random seed change every n seconds, where n is set by cfg.seedRefreshRate.
			-- This is useful for low-traffic wikis where new edits may not happen very often.
			math.randomseed(math.floor(os.time() / cfg.seedRefreshRate))
		end
	end
	if type(args) ~= 'table' then
		error('ti maikadua nga argumento iti p.main ket nasken a tabla')
	end
	return l[funcName](args, listType)
end
	
--------------------------------------------------------------------------------------
-- Process arguments from #invoke
--------------------------------------------------------------------------------------

local function makeWrapper(funcName, listType)
	-- This function provides a wrapper for argument-processing from #invoke.
	-- listType is only used with p.html_list, and is nil the rest of the time.
	return function (frame)
		-- If called via #invoke, use the args passed into the invoking template, or the args passed to #invoke if any exist.
		-- Otherwise assume args are being passed directly in from the debug console or from another Lua module.
		local origArgs
		if frame == mw.getCurrentFrame() then
			origArgs = frame:getParent().args
			for k, v in pairs(frame.args) do
				origArgs = frame.args
				break
			end
		else
			origArgs = frame
		end
		-- Trim whitespace and remove blank arguments.
		local args = {}
		for k, v in pairs(origArgs) do
			if type(v) == 'string' then
				v = mw.text.trim(v)
			end
			if v ~= '' then
				args[k] = v
			end
		end
		return p.main(funcName, args, listType)
	end
end

-- Process arguments for HTML list functions.
local htmlListFuncs = {
	bulleted_list           = 'bulleted',
	unbulleted_list         = 'unbulleted',
	horizontal_list         = 'horizontal',
	ordered_list            = 'ordered',
	horizontal_ordered_list = 'horizontal_ordered'
}
for funcName, listType in pairs(htmlListFuncs) do
	p[funcName] = makeWrapper('html_list', listType)
end

-- Process arguments for other functions.
local otherFuncs = {'number', 'date', 'item', 'list', 'text_list'}
for _, funcName in ipairs(otherFuncs) do
	p[funcName] = makeWrapper(funcName)
end

return p