<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://micras.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AImage_array</id>
	<title>Module:Image array - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://micras.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AImage_array"/>
	<link rel="alternate" type="text/html" href="https://micras.org/wiki/index.php?title=Module:Image_array&amp;action=history"/>
	<updated>2026-11-01T01:18:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://micras.org/wiki/index.php?title=Module:Image_array&amp;diff=201092&amp;oldid=prev</id>
		<title>Craitman at 19:57, 21 April 2021</title>
		<link rel="alternate" type="text/html" href="https://micras.org/wiki/index.php?title=Module:Image_array&amp;diff=201092&amp;oldid=prev"/>
		<updated>2021-04-21T19:57:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:57, 21 April 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l61&quot;&gt;Line 61:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 61:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	if rowcount &amp;lt; 1 then&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	if rowcount &amp;lt; 1 then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		return &#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Pages using image array with no images]]&lt;/del&gt;&#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		return &#039; &#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key hub-mw_:diff:1.41:old-200951:rev-201092:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Craitman</name></author>
	</entry>
	<entry>
		<id>https://micras.org/wiki/index.php?title=Module:Image_array&amp;diff=200951&amp;oldid=prev</id>
		<title>Kemal HagemaruFRP: Created page with &quot;-- implements template:image array  local p = {}  local function isnotempty(s) 	return s and s:match( &#039;^%s*(.-)%s*$&#039; ) ~= &#039;&#039; end  local function renderArrayCell( img, c, a...&quot;</title>
		<link rel="alternate" type="text/html" href="https://micras.org/wiki/index.php?title=Module:Image_array&amp;diff=200951&amp;oldid=prev"/>
		<updated>2021-04-19T14:32:53Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;-- implements &lt;a href=&quot;/mwiki/Template:Image_array&quot; title=&quot;Template:Image array&quot;&gt;template:image array&lt;/a&gt;  local p = {}  local function isnotempty(s) 	return s and s:match( &amp;#039;^%s*(.-)%s*$&amp;#039; ) ~= &amp;#039;&amp;#039; end  local function renderArrayCell( img, c, a...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- implements [[template:image array]]&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function isnotempty(s)&lt;br /&gt;
	return s and s:match( &amp;#039;^%s*(.-)%s*$&amp;#039; ) ~= &amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function renderArrayCell( img, c, a, b, l, tc, t, w, h)&lt;br /&gt;
	local alt = isnotempty(a) and (&amp;#039;|alt=&amp;#039; .. a) or &amp;#039;&amp;#039;&lt;br /&gt;
	local link = isnotempty(l) and (&amp;#039;|link=&amp;#039; .. l) or &amp;#039;&amp;#039;&lt;br /&gt;
	local text = (isnotempty(tc) and not isnotempty(t)) &lt;br /&gt;
		and mw.text.unstrip(c) or mw.text.unstrip(t or &amp;#039;&amp;#039;)&lt;br /&gt;
	local border = isnotempty(b) and &amp;#039;|border&amp;#039; or &amp;#039;&amp;#039;&lt;br /&gt;
		&lt;br /&gt;
	local cell = mw.html.create(&amp;#039;&amp;#039;)&lt;br /&gt;
	if( img ) then&lt;br /&gt;
		cell:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;display&amp;#039;, &amp;#039;table-cell&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;vertical-align&amp;#039;, &amp;#039;middle&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;width&amp;#039;, w .. &amp;#039;px&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;height&amp;#039;, h .. &amp;#039;px&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;margin-left&amp;#039;, &amp;#039;auto&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;margin-right&amp;#039;, &amp;#039;auto&amp;#039;)&lt;br /&gt;
			:wikitext(mw.ustring.format(&amp;#039;[[File:%s|%dx%dpx%s|%s]]&amp;#039;, &lt;br /&gt;
				img, w, h, alt .. link .. border, text))&lt;br /&gt;
		cell:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;padding&amp;#039;, &amp;#039;1px&amp;#039;)&lt;br /&gt;
			:wikitext(c)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return tostring(cell)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function imagearray( frame )&lt;br /&gt;
	local args = frame:getParent().args&lt;br /&gt;
	local width = tonumber(args[&amp;#039;width&amp;#039;] or &amp;#039;60&amp;#039;)&lt;br /&gt;
	local height = tonumber(args[&amp;#039;height&amp;#039;] or &amp;#039;70&amp;#039;)&lt;br /&gt;
	local perrow = tonumber(args[&amp;#039;perrow&amp;#039;] or &amp;#039;4&amp;#039;)&lt;br /&gt;
	local bw = tonumber(args[&amp;#039;border-width&amp;#039;] or &amp;#039;0&amp;#039;)&lt;br /&gt;
	local fs = args[&amp;#039;font-size&amp;#039;] or &amp;#039;88%&amp;#039;&lt;br /&gt;
	local text = args[&amp;#039;text&amp;#039;] or &amp;#039;&amp;#039;&lt;br /&gt;
	local margin = args[&amp;#039;margin&amp;#039;] or &amp;#039;auto&amp;#039;&lt;br /&gt;
	local border = ( bw &amp;gt; 0 ) and tostring(bw) .. &amp;#039;px #aaa solid&amp;#039; or nil&lt;br /&gt;
&lt;br /&gt;
	-- find all the nonempty image numbers&lt;br /&gt;
	local imagenums = {}&lt;br /&gt;
	local imagecount = 0&lt;br /&gt;
	for k, v in pairs( args ) do&lt;br /&gt;
		local i = tonumber(tostring(k):match( &amp;#039;^%s*image([%d]+)%s*$&amp;#039; ) or &amp;#039;0&amp;#039;)&lt;br /&gt;
		if( i &amp;gt; 0 and isnotempty(v) ) then&lt;br /&gt;
			table.insert( imagenums, i )&lt;br /&gt;
			imagecount = imagecount + 1&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- sort the image numbers&lt;br /&gt;
	table.sort(imagenums)&lt;br /&gt;
	&lt;br /&gt;
	-- compute the number of rows&lt;br /&gt;
	local rowcount = math.ceil(imagecount / perrow)&lt;br /&gt;
	&lt;br /&gt;
	if rowcount &amp;lt; 1 then&lt;br /&gt;
		return &amp;#039;[[Category:Pages using image array with no images]]&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- start table&lt;br /&gt;
	root = mw.html.create(&amp;#039;table&amp;#039;)&lt;br /&gt;
	root&lt;br /&gt;
		:addClass(args[&amp;#039;class&amp;#039;])&lt;br /&gt;
		:css(&amp;#039;border-collapse&amp;#039;,&amp;#039;collapse&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;text-align&amp;#039;,&amp;#039;center&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;font-size&amp;#039;, fs)&lt;br /&gt;
		:css(&amp;#039;line-height&amp;#039;,&amp;#039;1.25em&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;margin&amp;#039;,margin)&lt;br /&gt;
		:css(&amp;#039;width&amp;#039;, tostring(width*perrow) .. &amp;#039;px&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
	-- loop over the images&lt;br /&gt;
	for j = 1, rowcount do&lt;br /&gt;
		local row = root:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
		row:css(&amp;#039;vertical-align&amp;#039;, &amp;#039;top&amp;#039;)&lt;br /&gt;
		for k = 1, perrow do&lt;br /&gt;
			i = imagenums[(j-1)*perrow + k] or 0&lt;br /&gt;
			row:tag(&amp;#039;td&amp;#039;)&lt;br /&gt;
				:css(&amp;#039;width&amp;#039;, width .. &amp;#039;px&amp;#039;)&lt;br /&gt;
				:css(&amp;#039;text-align&amp;#039;, &amp;#039;center&amp;#039;)&lt;br /&gt;
				:css(border and &amp;#039;border&amp;#039; or &amp;#039;&amp;#039;, border or &amp;#039;&amp;#039;)&lt;br /&gt;
				:wikitext(renderArrayCell( &lt;br /&gt;
					args[&amp;#039;image&amp;#039; .. i], args[&amp;#039;caption&amp;#039; .. i], args[&amp;#039;alt&amp;#039; .. i], &lt;br /&gt;
					args[&amp;#039;border&amp;#039; .. i], args[&amp;#039;link&amp;#039; .. i] , &lt;br /&gt;
					args[&amp;#039;text&amp;#039;], args[&amp;#039;text&amp;#039; .. i] , width, height)&lt;br /&gt;
					)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
    &lt;br /&gt;
	-- end table&lt;br /&gt;
    return tostring(root)&lt;br /&gt;
end&lt;br /&gt;
function p.array( frame )&lt;br /&gt;
    return imagearray( frame )&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Kemal HagemaruFRP</name></author>
	</entry>
</feed>