<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AFamily_tree</id>
	<title>Module:Family tree - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AFamily_tree"/>
	<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Family_tree&amp;action=history"/>
	<updated>2026-04-30T23:52:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.runerealm.org/index.php?title=Module:Family_tree&amp;diff=34929&amp;oldid=prev</id>
		<title>Alex: Created page with &quot;-- Implements {{Family tree}} In this module and the template, top, right, bottom, left refer to the location of the line on a cross: -T- L#R -B- --  local p = {}  local borders = mw.loadData(&#039;Module:Family tree/data&#039;)  -- Main function function p.main(frame) 	local args = frame:getParent().args 	local cells = {} 	for i, v in ipairs(args) do 		-- Every param is unnamed, so needs trimming 		local v_x = mw.text.trim(v) 		-- Assume all blank parameters (trimmed to 0 len...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Family_tree&amp;diff=34929&amp;oldid=prev"/>
		<updated>2024-10-16T23:12:05Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;--[[ Implements {{Family tree}} In this module and the template, top, right, bottom, left refer to the location of the line on a cross: -T- L#R -B- --]]  local p = {}  local borders = mw.loadData(&amp;#039;Module:Family tree/data&amp;#039;)  -- Main function function p.main(frame) 	local args = frame:getParent().args 	local cells = {} 	for i, v in ipairs(args) do 		-- Every param is unnamed, so needs trimming 		local v_x = mw.text.trim(v) 		-- Assume all blank parameters (trimmed to 0 len...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[&lt;br /&gt;
Implements {{Family tree}}&lt;br /&gt;
In this module and the template, top, right, bottom, left refer to the location of the line on a cross:&lt;br /&gt;
-T-&lt;br /&gt;
L#R&lt;br /&gt;
-B-&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local borders = mw.loadData(&amp;#039;Module:Family tree/data&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
-- Main function&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = frame:getParent().args&lt;br /&gt;
	local cells = {}&lt;br /&gt;
	for i, v in ipairs(args) do&lt;br /&gt;
		-- Every param is unnamed, so needs trimming&lt;br /&gt;
		local v_x = mw.text.trim(v)&lt;br /&gt;
		-- Assume all blank parameters (trimmed to 0 length) are empty block cells&lt;br /&gt;
		if #v_x == 0 then&lt;br /&gt;
			v_x = &amp;#039; &amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		table.insert(cells,v_x)&lt;br /&gt;
	end&lt;br /&gt;
	return p._main(cells)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(cells)&lt;br /&gt;
	local ret = mw.html.create(&amp;#039;table&amp;#039;)&lt;br /&gt;
			:css({ [&amp;#039;border-spacing&amp;#039;] = &amp;#039;0&amp;#039;,&lt;br /&gt;
				[&amp;#039;line-height&amp;#039;] = &amp;#039;100%&amp;#039;,&lt;br /&gt;
				[&amp;#039;text-align&amp;#039;] = &amp;#039;center&amp;#039; })&lt;br /&gt;
&lt;br /&gt;
	local current_row = mw.html.create(&amp;#039;tr&amp;#039;)&lt;br /&gt;
	for i, v in ipairs(cells) do&lt;br /&gt;
		-- &amp;#039;_&amp;#039; character means &amp;quot;start a new row&amp;quot;&lt;br /&gt;
		-- Close current_row and add to the table&lt;br /&gt;
		-- Then recycle the param&lt;br /&gt;
		if v == &amp;#039;_&amp;#039; then&lt;br /&gt;
			ret:node(current_row:done())&lt;br /&gt;
			current_row = mw.html.create(&amp;#039;tr&amp;#039;)&lt;br /&gt;
		-- If a meta character, add a node for a block cell&lt;br /&gt;
		elseif borders[v] then&lt;br /&gt;
			block_cell(current_row,borders[v])&lt;br /&gt;
		-- Everything else, paste as is in a leaf&lt;br /&gt;
		else&lt;br /&gt;
			text_cell(current_row,v)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Close current row, add to main table, close everything, return&lt;br /&gt;
	ret:node(current_row:done())&lt;br /&gt;
		:done()&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Meta characters used to draw lines&lt;br /&gt;
function block_cell(builder,cell)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- We can use self closing &amp;lt;td /&amp;gt; to reduce expansion size, huehuehue&lt;br /&gt;
	-- Cells are:&lt;br /&gt;
	-- a1 a2&lt;br /&gt;
	-- b2 b2&lt;br /&gt;
	-- a1&amp;#039;s borders create TOP and LEFT lines&lt;br /&gt;
	-- a2&amp;#039;s borders create RIGHT line&lt;br /&gt;
	-- b1&amp;#039;s borders create BOTTOM line&lt;br /&gt;
	-- Each cell is 1em square&lt;br /&gt;
	-- Whole table is 2em x 2em&lt;br /&gt;
	--]]&lt;br /&gt;
	builder:tag(&amp;#039;td&amp;#039;)&lt;br /&gt;
		:addClass(&amp;#039;famtreesub&amp;#039;)&lt;br /&gt;
			:tag(&amp;#039;table&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
					:tag(&amp;#039;td&amp;#039;)&lt;br /&gt;
						:css({ [&amp;#039;border-right&amp;#039;] = cell.top,&lt;br /&gt;
							[&amp;#039;border-bottom&amp;#039;] = cell.left })&lt;br /&gt;
					:done()&lt;br /&gt;
					:tag(&amp;#039;td&amp;#039;)&lt;br /&gt;
						:css({ [&amp;#039;border-bottom&amp;#039;] = cell.right })&lt;br /&gt;
					:done()&lt;br /&gt;
				:done()&lt;br /&gt;
				:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
					:tag(&amp;#039;td&amp;#039;)&lt;br /&gt;
						:css({ [&amp;#039;border-right&amp;#039;] = cell.bottom })&lt;br /&gt;
					:done()&lt;br /&gt;
					:tag(&amp;#039;td&amp;#039;):done()&lt;br /&gt;
				:done()&lt;br /&gt;
			:done()&lt;br /&gt;
		:done()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- All other text&lt;br /&gt;
function text_cell(builder,text)&lt;br /&gt;
	builder:tag(&amp;#039;td&amp;#039;)&lt;br /&gt;
		:addClass(&amp;#039;famtreeleaf&amp;#039;)&lt;br /&gt;
		:attr(&amp;#039;colspan&amp;#039;,&amp;#039;3&amp;#039;)&lt;br /&gt;
		:wikitext(text)&lt;br /&gt;
		:done()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
</feed>