<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://ml.sayahna.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AList</id>
	<title>Module:List - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://ml.sayahna.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AList"/>
	<link rel="alternate" type="text/html" href="http://ml.sayahna.org/index.php?title=Module:List&amp;action=history"/>
	<updated>2026-04-23T23:46:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.5</generator>
	<entry>
		<id>http://ml.sayahna.org/index.php?title=Module:List&amp;diff=12760&amp;oldid=prev</id>
		<title>Cvr at 08:31, 22 August 2014</title>
		<link rel="alternate" type="text/html" href="http://ml.sayahna.org/index.php?title=Module:List&amp;diff=12760&amp;oldid=prev"/>
		<updated>2014-08-22T08:31:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;http://ml.sayahna.org/index.php?title=Module:List&amp;amp;diff=12760&amp;amp;oldid=12398&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Cvr</name></author>
		
	</entry>
	<entry>
		<id>http://ml.sayahna.org/index.php?title=Module:List&amp;diff=12398&amp;oldid=prev</id>
		<title>Cvr: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://ml.sayahna.org/index.php?title=Module:List&amp;diff=12398&amp;oldid=prev"/>
		<updated>2014-08-22T07:26:26Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 07:26, 22 August 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Cvr</name></author>
		
	</entry>
	<entry>
		<id>http://ml.sayahna.org/index.php?title=Module:List&amp;diff=12397&amp;oldid=prev</id>
		<title>Mr. Stradivarius: remove li_style, ul_style and ol_style parameters, allow itemn_style and itemn_value parameters, and add a tracking category for item_stylen and item_valuen parameters</title>
		<link rel="alternate" type="text/html" href="http://ml.sayahna.org/index.php?title=Module:List&amp;diff=12397&amp;oldid=prev"/>
		<updated>2014-06-12T09:21:46Z</updated>

		<summary type="html">&lt;p&gt;remove li_style, ul_style and ol_style parameters, allow itemn_style and itemn_value parameters, and add a tracking category for item_stylen and item_valuen parameters&lt;/p&gt;
&lt;a href=&quot;http://ml.sayahna.org/index.php?title=Module:List&amp;amp;diff=12397&amp;amp;oldid=4898&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Mr. Stradivarius</name></author>
		
	</entry>
	<entry>
		<id>http://ml.sayahna.org/index.php?title=Module:List&amp;diff=4898&amp;oldid=prev</id>
		<title>Admin: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://ml.sayahna.org/index.php?title=Module:List&amp;diff=4898&amp;oldid=prev"/>
		<updated>2014-03-23T05:07:33Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 05:07, 23 March 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
		
	</entry>
	<entry>
		<id>http://ml.sayahna.org/index.php?title=Module:List&amp;diff=4897&amp;oldid=prev</id>
		<title>Mr. Stradivarius: add fix to make the start parameter work with horizontal ordered lists, and switch to Module:Arguments for argument processing</title>
		<link rel="alternate" type="text/html" href="http://ml.sayahna.org/index.php?title=Module:List&amp;diff=4897&amp;oldid=prev"/>
		<updated>2014-01-07T03:15:57Z</updated>

		<summary type="html">&lt;p&gt;add fix to make the start parameter work with horizontal ordered lists, and switch to &lt;a href=&quot;/index.php/Module:Arguments&quot; title=&quot;Module:Arguments&quot;&gt;Module:Arguments&lt;/a&gt; for argument processing&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module outputs different kinds of lists. At the moment, bulleted, unbulleted,&lt;br /&gt;
-- horizontal, ordered, and horizontal ordered lists are supported.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local getArgs = require('Module:Arguments').getArgs&lt;br /&gt;
local htmlBuilder = require('Module:HtmlBuilder')&lt;br /&gt;
&lt;br /&gt;
local function getListItem(data, style, itemStyle, itemValue)&lt;br /&gt;
	if not data then&lt;br /&gt;
		return c&lt;br /&gt;
	end&lt;br /&gt;
	local item = htmlBuilder.create('li')&lt;br /&gt;
	item&lt;br /&gt;
		.cssText(style)&lt;br /&gt;
		.cssText(itemStyle)&lt;br /&gt;
		.wikitext(data)&lt;br /&gt;
	if(itemValue) then&lt;br /&gt;
		item.attr('value',itemValue)&lt;br /&gt;
	end&lt;br /&gt;
	return tostring(item)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getArgNums(args)&lt;br /&gt;
	-- Returns an array containing the keys of all positional arguments that contain data (i.e. non-whitespace values).&lt;br /&gt;
	local nums = {}&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		if type(k) == 'number' and &lt;br /&gt;
			k &amp;gt;= 1 and &lt;br /&gt;
			math.floor(k) == k and &lt;br /&gt;
			mw.ustring.match(v, '%S') then&lt;br /&gt;
				table.insert(nums, k)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	table.sort(nums)&lt;br /&gt;
	return nums&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeList(listType, args)&lt;br /&gt;
	-- This is the main function to be called from other Lua modules.&lt;br /&gt;
	-- First, get the list items.&lt;br /&gt;
	local listItems = {}&lt;br /&gt;
	local argNums = getArgNums(args)&lt;br /&gt;
	for i, num in ipairs(argNums) do&lt;br /&gt;
		local item = getListItem(&lt;br /&gt;
			args[num],&lt;br /&gt;
			args.item_style or args.li_style, -- li_style is included for backwards compatibility. item_style was included to be easier to understand for non-coders.&lt;br /&gt;
			args['item_style' .. tostring(num)] or args['li_style' .. tostring(num)],&lt;br /&gt;
			args['item_value' .. tostring(num)]&lt;br /&gt;
		)&lt;br /&gt;
		table.insert(listItems, item)&lt;br /&gt;
	end&lt;br /&gt;
	if #listItems == 0 then&lt;br /&gt;
		return ''&lt;br /&gt;
	end&lt;br /&gt;
	-- Build the opening div tag.&lt;br /&gt;
	local root = htmlBuilder.create('div')&lt;br /&gt;
	if listType == 'horizontal' or listType == 'horizontal_ordered' then&lt;br /&gt;
		root.addClass('hlist')&lt;br /&gt;
	elseif listType == 'unbulleted' then&lt;br /&gt;
		root.addClass('plainlist')&lt;br /&gt;
	end&lt;br /&gt;
	root.addClass(args.class)&lt;br /&gt;
	if listType == 'horizontal' or listType == 'horizontal_ordered' then&lt;br /&gt;
		local indent = tonumber(args.indent)&lt;br /&gt;
		indent = tostring((indent and indent * 1.6) or 0)&lt;br /&gt;
		root.css('margin-left', indent .. 'em')&lt;br /&gt;
	end&lt;br /&gt;
	-- If we are outputting an ordered list or an ordered horizontal list, get the type and list-style-type.&lt;br /&gt;
	-- Horizontal ordered lists aren't supported yet, but including them anyway in case support is ever added to the CSS backend.&lt;br /&gt;
	local listStyleType, typeAttr&lt;br /&gt;
	if listType == 'ordered' or listType == 'horizontal_ordered' then &lt;br /&gt;
		listStyleType = args.list_style_type or args['list-style-type']&lt;br /&gt;
		typeAttr = args['type']&lt;br /&gt;
	end&lt;br /&gt;
	-- Detect if the type attribute specified by args.type is using an invalid value, and if so try passing it as a list-style-type CSS property.&lt;br /&gt;
	if typeAttr and not typeAttr:match('^%s*[1AaIi]%s*$') then&lt;br /&gt;
		if not listStyleType then&lt;br /&gt;
			listStyleType = typeAttr&lt;br /&gt;
			typeAttr = nil&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	root.cssText(args.style)&lt;br /&gt;
	-- Build the list tags and list items.&lt;br /&gt;
	local list = root.tag((listType == 'ordered' or listType == 'horizontal_ordered') and 'ol' or 'ul')&lt;br /&gt;
	local start = args.start&lt;br /&gt;
	list&lt;br /&gt;
		.attr('start', start)&lt;br /&gt;
	if listType == 'horizontal_ordered' then&lt;br /&gt;
		-- Apply fix to get start numbers working with horizontal ordered lists.&lt;br /&gt;
		local startNum = tonumber(start)&lt;br /&gt;
		if startNum then&lt;br /&gt;
			list.css('counter-reset', 'listitem ' .. tostring(startNum - 1))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	list&lt;br /&gt;
		.attr('type', typeAttr)&lt;br /&gt;
		.css('list-style-type', listStyleType)&lt;br /&gt;
		.cssText(args.list_style or args.ul_style or args.ol_style) -- ul_style and ol_style are included for backwards compatibility. No distinction is made for ordered or unordered lists.&lt;br /&gt;
		.wikitext(table.concat(listItems))&lt;br /&gt;
	return tostring(root)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function makeWrapper(listType)&lt;br /&gt;
	return function(frame)&lt;br /&gt;
		local args = getArgs(frame, {&lt;br /&gt;
			valueFunc = function (key, value)&lt;br /&gt;
				if type(key) == 'number' or value ~= '' then&lt;br /&gt;
					return value&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		})&lt;br /&gt;
		return p.makeList(listType, args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local funcNames = {'bulleted', 'unbulleted', 'horizontal', 'ordered', 'horizontal_ordered'}&lt;br /&gt;
&lt;br /&gt;
for _, funcName in ipairs(funcNames) do&lt;br /&gt;
	p[funcName] = makeWrapper(funcName)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Mr. Stradivarius</name></author>
		
	</entry>
</feed>