<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://cherry-pi.tailb1a250.ts.net/index.php?action=history&amp;feed=atom&amp;title=Module%3AInfoboxLua</id>
	<title>Module:InfoboxLua - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://cherry-pi.tailb1a250.ts.net/index.php?action=history&amp;feed=atom&amp;title=Module%3AInfoboxLua"/>
	<link rel="alternate" type="text/html" href="https://cherry-pi.tailb1a250.ts.net/index.php?title=Module:InfoboxLua&amp;action=history"/>
	<updated>2026-11-11T04:19:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://cherry-pi.tailb1a250.ts.net/index.php?title=Module:InfoboxLua&amp;diff=426&amp;oldid=prev</id>
		<title>Gravy at 03:29, 14 June 2026</title>
		<link rel="alternate" type="text/html" href="https://cherry-pi.tailb1a250.ts.net/index.php?title=Module:InfoboxLua&amp;diff=426&amp;oldid=prev"/>
		<updated>2026-06-14T03:29:08Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&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 20:29, 13 June 2026&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-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&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;require(&amp;#039;strict&amp;#039;)&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;require(&amp;#039;strict&amp;#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;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;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;local PLACEHOLDER_IMAGE = &#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Placeholderv2&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;png&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;local PLACEHOLDER_IMAGE = &#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Placeholder&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;webp&lt;/ins&gt;&#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;local PLACEHOLDER_IMAGE_SIZE = 400&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;local PLACEHOLDER_IMAGE_SIZE = 400&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;local INFOBOX_WIDTH = 400&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;local INFOBOX_WIDTH = 400&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key paracosm:diff:1.41:old-425:rev-426:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Gravy</name></author>
	</entry>
	<entry>
		<id>https://cherry-pi.tailb1a250.ts.net/index.php?title=Module:InfoboxLua&amp;diff=425&amp;oldid=prev</id>
		<title>Gravy: 1 revision imported from :starcitizen:Module:InfoboxLua</title>
		<link rel="alternate" type="text/html" href="https://cherry-pi.tailb1a250.ts.net/index.php?title=Module:InfoboxLua&amp;diff=425&amp;oldid=prev"/>
		<updated>2026-06-14T03:28:59Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported from &lt;a href=&quot;/index.php?title=Starcitizen:Module:InfoboxLua&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Starcitizen:Module:InfoboxLua (page does not exist)&quot;&gt;starcitizen:Module:InfoboxLua&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&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 20:28, 13 June 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&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;!-- diff cache key paracosm:diff:1.41:old-424:rev-425 --&gt;
&lt;/table&gt;</summary>
		<author><name>Gravy</name></author>
	</entry>
	<entry>
		<id>https://cherry-pi.tailb1a250.ts.net/index.php?title=Module:InfoboxLua&amp;diff=424&amp;oldid=prev</id>
		<title>starcitizen&gt;Alistair3149: Drop whole-infobox collapse wrapper; free top-right corner for overlays (via update-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://cherry-pi.tailb1a250.ts.net/index.php?title=Module:InfoboxLua&amp;diff=424&amp;oldid=prev"/>
		<updated>2026-05-26T23:35:32Z</updated>

		<summary type="html">&lt;p&gt;Drop whole-infobox collapse wrapper; free top-right corner for overlays (via update-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require(&amp;#039;strict&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local PLACEHOLDER_IMAGE = &amp;#039;Placeholderv2.png&amp;#039;&lt;br /&gt;
local PLACEHOLDER_IMAGE_SIZE = 400&lt;br /&gt;
local INFOBOX_WIDTH = 400&lt;br /&gt;
&lt;br /&gt;
local headerComponent = require(&amp;#039;Module:InfoboxLua/Components/Header&amp;#039;)&lt;br /&gt;
local sectionComponent = require(&amp;#039;Module:InfoboxLua/Components/Section&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
--- @class InfoboxLuaData&lt;br /&gt;
--- @field class string|nil An additional HTML class for the infobox&amp;#039;s container. Optional.&lt;br /&gt;
--- @field css table&amp;lt;string, string&amp;gt;|nil Additional CSS rules for the infobox. Optional.&lt;br /&gt;
--- @field title string The title of the infobox.&lt;br /&gt;
--- @field subtitle string|nil The subtitle of the infobox. Optional.&lt;br /&gt;
--- @field image ImageComponentData|string|nil The main image of the infobox. Optional.&lt;br /&gt;
--- @field images table&amp;lt;ImageComponentData&amp;gt;|nil The images of the infobox. Optional.&lt;br /&gt;
--- @field sections table&amp;lt;SectionComponentData&amp;gt;|nil The sections of the infobox. Optional.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
--- Get the image data&lt;br /&gt;
---&lt;br /&gt;
--- @param image string|ImageComponentData&lt;br /&gt;
--- @return ImageComponentData&lt;br /&gt;
local function getImageData(image)&lt;br /&gt;
	local imageData = {}&lt;br /&gt;
&lt;br /&gt;
	if type(image) == &amp;#039;string&amp;#039; then&lt;br /&gt;
		imageData.src = image&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if type(image) == &amp;#039;table&amp;#039; then&lt;br /&gt;
		imageData = image&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if type(imageData.size) ~= &amp;#039;number&amp;#039; then&lt;br /&gt;
		imageData.size = INFOBOX_WIDTH&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- No image source, use placeholder&lt;br /&gt;
	if type(imageData.src) ~= &amp;#039;string&amp;#039; then&lt;br /&gt;
		imageData.src = PLACEHOLDER_IMAGE&lt;br /&gt;
		imageData.size = PLACEHOLDER_IMAGE_SIZE&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return imageData&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- @param data InfoboxLuaData&lt;br /&gt;
--- @return mw.html&lt;br /&gt;
local function getContentHtml(data)&lt;br /&gt;
	local contentHtml = mw.html.create(&amp;#039;div&amp;#039;):addClass(&amp;#039;t-infobox-content&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
	contentHtml:node(headerComponent.getHtml({&lt;br /&gt;
		title = data.title,&lt;br /&gt;
		subtitle = data.subtitle or nil,&lt;br /&gt;
		image = getImageData(data.image),&lt;br /&gt;
		images = data.images or nil,&lt;br /&gt;
	}))&lt;br /&gt;
&lt;br /&gt;
	for _, section in ipairs(data.sections) do&lt;br /&gt;
		local sectionHtml = sectionComponent.getHtml(section)&lt;br /&gt;
		if sectionHtml then&lt;br /&gt;
			contentHtml:node(sectionHtml)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return contentHtml&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- @param data InfoboxLuaData&lt;br /&gt;
--- @return mw.html&lt;br /&gt;
local function getInfoboxHtml(data)&lt;br /&gt;
	local root = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	root:addClass(&amp;#039;t-infobox floatright&amp;#039;)&lt;br /&gt;
		:addClass(data.class)&lt;br /&gt;
		:attr(&amp;#039;role&amp;#039;, &amp;#039;complementary&amp;#039;)&lt;br /&gt;
		:attr(&amp;#039;aria-label&amp;#039;, data.title)&lt;br /&gt;
		:css(&amp;#039;max-width&amp;#039;, INFOBOX_WIDTH .. &amp;#039;px&amp;#039;)&lt;br /&gt;
		:node(getContentHtml(data))&lt;br /&gt;
&lt;br /&gt;
	if type(data.css) == &amp;#039;table&amp;#039; then&lt;br /&gt;
		for cssProperty, cssValue in pairs(data.css) do&lt;br /&gt;
			root:css(cssProperty, cssValue)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return root&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- @param data InfoboxLuaData&lt;br /&gt;
--- @return string&lt;br /&gt;
function p.render(data)&lt;br /&gt;
	local html = getInfoboxHtml(data)&lt;br /&gt;
	local styles = mw.getCurrentFrame():extensionTag({&lt;br /&gt;
		name = &amp;#039;templatestyles&amp;#039;,&lt;br /&gt;
		args = { src = &amp;#039;Module:InfoboxLua/styles.css&amp;#039; },&lt;br /&gt;
	})&lt;br /&gt;
&lt;br /&gt;
	return styles .. tostring(html)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.test()&lt;br /&gt;
	local data = mw.loadJsonData(&amp;#039;Module:InfoboxLua/testData.json&amp;#039;)&lt;br /&gt;
	local html = p.render(data)&lt;br /&gt;
&lt;br /&gt;
	mw.logObject(data)&lt;br /&gt;
	mw.logObject(html)&lt;br /&gt;
&lt;br /&gt;
	return html&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>starcitizen&gt;Alistair3149</name></author>
	</entry>
</feed>