<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://drl.droidbuilders.net/index.php?action=history&amp;feed=atom&amp;title=Module%3AEras</id>
	<title>Module:Eras - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://drl.droidbuilders.net/index.php?action=history&amp;feed=atom&amp;title=Module%3AEras"/>
	<link rel="alternate" type="text/html" href="https://drl.droidbuilders.net/index.php?title=Module:Eras&amp;action=history"/>
	<updated>2026-05-09T06:53:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.6</generator>
	<entry>
		<id>https://drl.droidbuilders.net/index.php?title=Module:Eras&amp;diff=3966&amp;oldid=prev</id>
		<title>Drl-admin: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://drl.droidbuilders.net/index.php?title=Module:Eras&amp;diff=3966&amp;oldid=prev"/>
		<updated>2018-08-12T16:26:33Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- &amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
--                              Module:Eras&lt;br /&gt;
--&lt;br /&gt;
-- This module renders the icons in the top-right corner of articles, as well&lt;br /&gt;
-- as the Canon and Legends tabs for pages with a Canon/Legends counterpart.&lt;br /&gt;
-- It also formats the page title with {{DISPLAYTITLE}}. It is a rewrite of&lt;br /&gt;
-- [[Template:Eras]].&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local DEBUG_MODE = false -- if true, errors are not caught&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Icon data&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- This table stores data for all the icons displayed in the top-right. It can&lt;br /&gt;
-- have the following fields:&lt;br /&gt;
-- * image - the icon image name, minus any &amp;quot;File:&amp;quot; prefix (required).&lt;br /&gt;
-- * tooltip - the icon tooltip (optional).&lt;br /&gt;
-- * link - the page to link from the icon (optional).&lt;br /&gt;
-- * category - a category to go with the icon, minus any &amp;quot;Category:&amp;quot; prefix&lt;br /&gt;
--     (optional).&lt;br /&gt;
-- * protectionAction - for protection icons, an action such as &amp;quot;edit&amp;quot; or &amp;quot;move&amp;quot;&lt;br /&gt;
--     to check (optional).&lt;br /&gt;
-- * protectionLevel - for protection icons, the protection level to check,&lt;br /&gt;
--     such as &amp;quot;sysop&amp;quot;. If the page doesn&amp;#039;t have the right protection level&lt;br /&gt;
--     it is put in a tracking category and the icon is not displayed&lt;br /&gt;
--     (optional).&lt;br /&gt;
-- Note: this is just a convenient place to store the data. The subtables are&lt;br /&gt;
-- accessed from the code manually, so adding new subtables won&amp;#039;t automatically&lt;br /&gt;
-- add new icons, and removing subtables may break things.&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
local iconData = {&lt;br /&gt;
	pre = {&lt;br /&gt;
		image = &amp;quot;Premium-Era-pre.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;The subject of this article appeared before the Before the Republic era.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Pre-Republic era&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	btr = {&lt;br /&gt;
		image = &amp;quot;Premium-Era-pre.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;The subject of this article appeared Before the Republic.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Before the Republic&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	old = {&lt;br /&gt;
		image = &amp;quot;Premium-Era-old.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;The subject of this article appeared in the Old Republic era.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Old Republic era&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	imp = {&lt;br /&gt;
		image = &amp;quot;Premium-Era-imp.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;The subject of this article appeared in the Rise of the Empire era.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Rise of the Empire era&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	reb = {&lt;br /&gt;
		image = &amp;quot;Premium-Era-reb.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;The subject of this article appeared in the Rebellion era.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Rebellion era&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	new = {&lt;br /&gt;
		image = &amp;quot;Premium-Era-new.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;The subject of this article appeared in the New Republic era.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;New Republic era&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	njo = {&lt;br /&gt;
		image = &amp;quot;Premium-Era-njo.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;The subject of this article appeared in the New Jedi Order era.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;New Jedi Order era&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	leg = {&lt;br /&gt;
		image = &amp;quot;Premium-Era-leg.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;The subject of this article appeared in the Legacy era.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Legacy era&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	inf = {&lt;br /&gt;
		image = &amp;quot;Premium-Era-inf.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;The subject of this article is considered part of Star Wars Infinities.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Infinities&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	real = {&lt;br /&gt;
		image = &amp;quot;Premium-Era-real.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;The subject of this article exists in or is relevant to the real world.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Category:Real-world articles&amp;quot;,&lt;br /&gt;
		category = &amp;quot;Real-world articles&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	featured = {&lt;br /&gt;
		image = &amp;quot;Premium-FeaturedIcon.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;This is a Wookieepedia Featured Article.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Wookieepedia:Featured articles&amp;quot;,&lt;br /&gt;
		category = &amp;quot;Wookieepedia featured articles&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	former = {&lt;br /&gt;
		image = &amp;quot;Premium-DefeaturedIcon.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;This is a former Wookieepedia Featured Article.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Wookieepedia:Featured articles&amp;quot;,&lt;br /&gt;
		category = &amp;quot;Wookieepedia former featured articles&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	good = {&lt;br /&gt;
		image = &amp;quot;Premium-GoodIcon.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;This is a Wookieepedia Good Article.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Wookieepedia:Good articles&amp;quot;,&lt;br /&gt;
		category = &amp;quot;Wookieepedia good articles&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	fga = {&lt;br /&gt;
		image = &amp;quot;Premium-FormerGAicon.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;This is a former Wookieepedia Good Article.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Wookieepedia:Good articles&amp;quot;,&lt;br /&gt;
		category = &amp;quot;Wookieepedia former good articles&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	comp = {&lt;br /&gt;
		image = &amp;quot;Premium-ComprehensiveArticle.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;This is a Wookieepedia Comprehensive Article.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Wookieepedia:Comprehensive articles&amp;quot;,&lt;br /&gt;
		category = &amp;quot;Wookieepedia comprehensive articles&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	fca = {&lt;br /&gt;
		image = &amp;quot;Premium-FormerCAIcon.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;This is a former Wookieepedia Comprehensive Article.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Wookieepedia:Comprehensive articles&amp;quot;,&lt;br /&gt;
		category = &amp;quot;Wookieepedia former comprehensive articles&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	fprot = {&lt;br /&gt;
		protectionAction = &amp;quot;edit&amp;quot;,&lt;br /&gt;
		protectionLevel = &amp;quot;sysop&amp;quot;,&lt;br /&gt;
		image = &amp;quot;Premium-Era-Fprotect.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;This article is protected from editing.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Wookieepedia:Protection_policy#Full_protection&amp;quot;,&lt;br /&gt;
		category = &amp;quot;Protected&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	sprot = {&lt;br /&gt;
		protectionAction = &amp;quot;edit&amp;quot;,&lt;br /&gt;
		protectionLevel = &amp;quot;autoconfirmed&amp;quot;,&lt;br /&gt;
		image = &amp;quot;Premium-Era-Sprotect.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;This article is semi-protected.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Wookieepedia:Protection_policy#Semi-protection&amp;quot;,&lt;br /&gt;
		category = &amp;quot;Semi-protected articles&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	ssprot = {&lt;br /&gt;
		image = &amp;quot;Premium-Era-Ssprotect.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;This article is super-semi-protected.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Wookieepedia:Protection_policy#Super-semi-protection&amp;quot;,&lt;br /&gt;
		category = &amp;quot;Super-semi-protected articles&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	mprot = {&lt;br /&gt;
		protectionAction = &amp;quot;move&amp;quot;,&lt;br /&gt;
		protectionLevel = &amp;quot;sysop&amp;quot;,&lt;br /&gt;
		image = &amp;quot;Premium-Era-Mprotect.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;This article is move protected.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Wookieepedia:Protection_policy#Move protection&amp;quot;,&lt;br /&gt;
		category = &amp;quot;Move protected articles&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	uprot = {&lt;br /&gt;
		protectionAction = &amp;quot;upload&amp;quot;,&lt;br /&gt;
		protectionLevel = &amp;quot;sysop&amp;quot;,&lt;br /&gt;
		image = &amp;quot;Premium-Era-Uprotect.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;This file is upload protected.&amp;quot;,&lt;br /&gt;
		link = &amp;quot;Wookieepedia:Protection_policy#Upload protection&amp;quot;,&lt;br /&gt;
		category = &amp;quot;Upload protected files&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	noncanon = {&lt;br /&gt;
		image = &amp;quot;Premium-Era-inf.png&amp;quot;,&lt;br /&gt;
		tooltip = &amp;quot;The subject of this article is considered non-canon.&amp;quot;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Helper functions&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- Find whether the specified page exists. We use pcall to catch errors if we&lt;br /&gt;
-- are over the expensive parser function count limit, or a number of other&lt;br /&gt;
-- juicy errors. This function increases the expensive parser function count&lt;br /&gt;
-- for every new page called.&lt;br /&gt;
local function exists(page)&lt;br /&gt;
	local success, title = pcall(mw.title.new, page)&lt;br /&gt;
	return success and title and title.exists or false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Eras class&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- The eras class does all of the heavy lifting in the module. We use a class&lt;br /&gt;
-- rather than normal functions so that we can avoid passing lots of different&lt;br /&gt;
-- values around for each different function.&lt;br /&gt;
&lt;br /&gt;
local Eras = {}&lt;br /&gt;
Eras.__index = Eras -- Set up inheritance for tables that use Eras as a metatable.&lt;br /&gt;
&lt;br /&gt;
-- This function makes a new eras object. Here we set all the values from the&lt;br /&gt;
-- arguments and do any preprocessing that we need.&lt;br /&gt;
function Eras.new(args, title)&lt;br /&gt;
	local obj = setmetatable({}, Eras) -- Make our object inherit from Eras.&lt;br /&gt;
	obj.title = title or mw.title.getCurrentTitle()&lt;br /&gt;
&lt;br /&gt;
	-- Set object structure&lt;br /&gt;
	obj.categories = {}&lt;br /&gt;
&lt;br /&gt;
	-- Set display title parameters&lt;br /&gt;
	obj.noDisplayTitle = args.notitle&lt;br /&gt;
	obj.displayTitleBase = args.title&lt;br /&gt;
	obj.displayTitleParen = args.title2&lt;br /&gt;
&lt;br /&gt;
	-- Set hidden status&lt;br /&gt;
	obj.isHidden = args.hide&lt;br /&gt;
	&lt;br /&gt;
	-- Set notoc value&lt;br /&gt;
	obj.hideToc = args.notoc&lt;br /&gt;
&lt;br /&gt;
	-- Set the continuity override (the &amp;quot;type&amp;quot; parameter)&lt;br /&gt;
	if args.type then&lt;br /&gt;
		local override = args.type:lower()&lt;br /&gt;
		if override ~= &amp;#039;canon&amp;#039; and override ~= &amp;#039;legends&amp;#039; then&lt;br /&gt;
			if override == &amp;#039;lego&amp;#039; then&lt;br /&gt;
				return false&lt;br /&gt;
			end&lt;br /&gt;
			obj:raiseError(&amp;quot;if the &amp;#039;type&amp;#039; parameter is specified, it must &amp;quot; ..&lt;br /&gt;
				&amp;quot;have a value of &amp;#039;canon&amp;#039; or &amp;#039;legends&amp;#039;&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
		obj.continuityOverride = override&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Set canon and legends article names for the subject&lt;br /&gt;
	obj.legendsArticle = args.legends&lt;br /&gt;
	obj.canonArticle = args.canon&lt;br /&gt;
	&lt;br /&gt;
	if args.canon then&lt;br /&gt;
		obj.check = true&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Get the icon data.&lt;br /&gt;
	do&lt;br /&gt;
		local icons = {}&lt;br /&gt;
		for _, v in ipairs(args) do&lt;br /&gt;
			local t = iconData[string.lower(v)]&lt;br /&gt;
			if t then&lt;br /&gt;
				icons[string.lower(v)] = t&lt;br /&gt;
			else&lt;br /&gt;
				-- The specified icon wasn&amp;#039;t found in the icon data, so set a&lt;br /&gt;
				-- tracking category flag.&lt;br /&gt;
				obj.hasBadParameter = true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		obj.icons = icons&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return obj&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Raise an error. If DEBUG_MODE is set to false, then errors raised here&lt;br /&gt;
-- are caught by the export function p._main.&lt;br /&gt;
function Eras:raiseError(msg)&lt;br /&gt;
	local level&lt;br /&gt;
	if DEBUG_MODE then&lt;br /&gt;
		level = nil&lt;br /&gt;
	else&lt;br /&gt;
		level = 0 -- Suppress module name and line number in the error message.&lt;br /&gt;
	end&lt;br /&gt;
	error(msg, level)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Add a category, to be rendered at the very end of the template output.&lt;br /&gt;
function Eras:addCategory(cat, sort)&lt;br /&gt;
	table.insert(self.categories, {category = cat, sortKey = sort})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Shortcut method for getting an icon data subtable.&lt;br /&gt;
function Eras:getIconData(code)&lt;br /&gt;
	return self.icons[code]&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Whether the current title ends with /Canon.&lt;br /&gt;
function Eras:hasCanonTitle()&lt;br /&gt;
	return self.title.text:find(&amp;#039;/Canon$&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Whether the current title ends with /Legends.&lt;br /&gt;
function Eras:hasLegendsTitle()&lt;br /&gt;
	return self.title.text:find(&amp;#039;/Legends$&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Returns a boolean showing whether any of the icons were specified by the&lt;br /&gt;
-- user.&lt;br /&gt;
function Eras:hasAnyOfIcons(...)&lt;br /&gt;
	for i = 1, select(&amp;#039;#&amp;#039;, ...) do&lt;br /&gt;
		if self:getIconData(select(i, ...)) then&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
-- Analyses the page name and sets {{DISPLAYTITLE}}.&lt;br /&gt;
function Eras:renderDisplayTitle()&lt;br /&gt;
	local pagename = self.title.text&lt;br /&gt;
&lt;br /&gt;
	-- Exit if we have been told not to set a title or if the title begins with&lt;br /&gt;
	-- an opening parenthesis.&lt;br /&gt;
	if self.noDisplayTitle or pagename:find(&amp;#039;^%(&amp;#039;) then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Find the display base and the display parentheses.&lt;br /&gt;
	local dBase = self.displayTitleBase&lt;br /&gt;
	local dParen = self.displayTitleParen&lt;br /&gt;
	if not dBase or not dParen then&lt;br /&gt;
		-- Analyse the pagename to find base part and any ending parentheses.&lt;br /&gt;
		-- /Canon is removed, and parentheses are only recognised if they are&lt;br /&gt;
		-- at the end of the pagename.&lt;br /&gt;
		local trimmedPagename = pagename:gsub(&amp;#039;/Canon$&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
		trimmedPagename = trimmedPagename:gsub(&amp;#039;/Legends$&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
		local base, paren = trimmedPagename:match(&amp;#039;^(.*)%s*%((.-)%)$&amp;#039;)&lt;br /&gt;
		if not base then&lt;br /&gt;
			base = trimmedPagename&lt;br /&gt;
		end&lt;br /&gt;
		-- Use the values we found, but only if a value has not already been&lt;br /&gt;
		-- specified.&lt;br /&gt;
		dBase = dBase or base&lt;br /&gt;
		dParen = dParen or paren&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Build the display string&lt;br /&gt;
	local display&lt;br /&gt;
	if dParen then&lt;br /&gt;
		display = string.format(&amp;#039;%s &amp;lt;small&amp;gt;(%s)&amp;lt;/small&amp;gt;&amp;#039;, dBase, dParen)&lt;br /&gt;
	else&lt;br /&gt;
		display = dBase&lt;br /&gt;
	end&lt;br /&gt;
	if self.title.namespace ~= 0 then&lt;br /&gt;
		display = mw.site.namespaces[self.title.namespace].name .. &amp;#039;:&amp;#039; .. display&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Return the expanded DISPLAYTITLE parser function.&lt;br /&gt;
	return mw.getCurrentFrame():preprocess(string.format(&lt;br /&gt;
		&amp;#039;{{DISPLAYTITLE:%s}}&amp;#039;,&lt;br /&gt;
		display&lt;br /&gt;
	))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Renders an eras icon from the given icon data. It deals with the image,&lt;br /&gt;
-- tooltip, link, and the category, but not the protection fields.&lt;br /&gt;
function Eras:renderIcon(data)&lt;br /&gt;
	-- Render the category at the end if it exists.&lt;br /&gt;
	if data.category then&lt;br /&gt;
		self:addCategory(data.category)&lt;br /&gt;
	end&lt;br /&gt;
	-- Render the icon and return it.&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	ret[#ret + 1] = &amp;#039;[[File:&amp;#039;&lt;br /&gt;
	ret[#ret + 1] = data.image&lt;br /&gt;
	if data.tooltip then&lt;br /&gt;
		ret[#ret + 1] = &amp;#039;|&amp;#039;&lt;br /&gt;
		ret[#ret + 1] = data.tooltip&lt;br /&gt;
	end&lt;br /&gt;
	if data.link then&lt;br /&gt;
		ret[#ret + 1] = &amp;#039;|link=&amp;#039;&lt;br /&gt;
		ret[#ret + 1] = data.link&lt;br /&gt;
	end&lt;br /&gt;
	ret[#ret + 1] = &amp;#039;]]&amp;#039;&lt;br /&gt;
	return table.concat(ret)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Renders a protection eras icon from the given data. If the page doesn&amp;#039;t have&lt;br /&gt;
-- the specified protection level, returns nil and adds a flag to add a&lt;br /&gt;
-- tracking category later on in processing.&lt;br /&gt;
function Eras:renderProtectionIcon(data)&lt;br /&gt;
	if not data.protectionAction then&lt;br /&gt;
		return self:renderIcon(data)&lt;br /&gt;
	end&lt;br /&gt;
	local protectionLevel = self.title.protectionLevels[data.protectionAction]&lt;br /&gt;
	protectionLevel = protectionLevel and protectionLevel[1]&lt;br /&gt;
	if protectionLevel and protectionLevel == data.protectionLevel then&lt;br /&gt;
		return self:renderIcon(data)&lt;br /&gt;
	else&lt;br /&gt;
		self.hasIncorrectProtectionIcon = true&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Renders the first icon, either Canon or Legends, or nil if the continuity&lt;br /&gt;
-- couldn&amp;#039;t be determined. This is equivalent to the previous {{Eraicon/canon}}&lt;br /&gt;
-- template.&lt;br /&gt;
function Eras:renderContinuityIcon()&lt;br /&gt;
	if self.check then&lt;br /&gt;
		self:addCategory(&amp;#039;Differing article titles&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- First, find what continuity to use, if any.&lt;br /&gt;
	local continuity, isUsingCategory&lt;br /&gt;
	if self.continuityOverride == &amp;#039;legends&amp;#039; then&lt;br /&gt;
		continuity = &amp;#039;legends&amp;#039;&lt;br /&gt;
		if not self:hasAnyOfIcons(&amp;#039;real&amp;#039;) then&lt;br /&gt;
			isUsingCategory = true&lt;br /&gt;
		end&lt;br /&gt;
	elseif self.title.namespace == 0 then&lt;br /&gt;
		if self:hasLegendsTitle() then&lt;br /&gt;
			continuity = &amp;#039;legends&amp;#039;&lt;br /&gt;
			isUsingCategory = true&lt;br /&gt;
		elseif self:hasCanonTitle() then&lt;br /&gt;
			continuity = &amp;#039;canon&amp;#039;&lt;br /&gt;
			isUsingCategory = true&lt;br /&gt;
		elseif self.legendsArticle then&lt;br /&gt;
			continuity = &amp;#039;canon&amp;#039;&lt;br /&gt;
			isUsingCategory = true&lt;br /&gt;
		elseif self.canonArticle then&lt;br /&gt;
			continuity = &amp;#039;legends&amp;#039;&lt;br /&gt;
			isUsingCategory = true&lt;br /&gt;
		elseif exists(self.title.text .. &amp;#039;/Legends&amp;#039;) then&lt;br /&gt;
			continuity = &amp;#039;canon&amp;#039;&lt;br /&gt;
			isUsingCategory = true&lt;br /&gt;
		elseif exists(self.title.text .. &amp;#039;/Canon&amp;#039;) then&lt;br /&gt;
			continuity = &amp;#039;legends&amp;#039;&lt;br /&gt;
			isUsingCategory = true&lt;br /&gt;
		elseif self:hasAnyOfIcons(&amp;#039;pre&amp;#039;, &amp;#039;btr&amp;#039;, &amp;#039;old&amp;#039;, &amp;#039;imp&amp;#039;, &amp;#039;reb&amp;#039;, &amp;#039;new&amp;#039;,&lt;br /&gt;
			&amp;#039;njo&amp;#039;, &amp;#039;leg&amp;#039;)&lt;br /&gt;
		then&lt;br /&gt;
			continuity = &amp;#039;legends&amp;#039;&lt;br /&gt;
			if self:hasAnyOfIcons(&amp;#039;real&amp;#039;) then&lt;br /&gt;
				isUsingCategory = false&lt;br /&gt;
			else&lt;br /&gt;
				isUsingCategory = true&lt;br /&gt;
			end&lt;br /&gt;
		elseif self:hasAnyOfIcons(&amp;#039;inf&amp;#039;, &amp;#039;noncanon&amp;#039;) then&lt;br /&gt;
			continuity = &amp;#039;legends&amp;#039;&lt;br /&gt;
			isUsingCategory = false&lt;br /&gt;
		elseif self:hasAnyOfIcons(&amp;#039;real&amp;#039;) then&lt;br /&gt;
			if self.continuityOverride == &amp;#039;canon&amp;#039; then&lt;br /&gt;
				continuity = &amp;#039;canon&amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
			isUsingCategory = false&lt;br /&gt;
		else&lt;br /&gt;
			continuity = &amp;#039;canon&amp;#039;&lt;br /&gt;
			isUsingCategory = true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Generate the icon data and make the icon.&lt;br /&gt;
	if continuity == &amp;#039;canon&amp;#039; then&lt;br /&gt;
		local data = {&lt;br /&gt;
			image = &amp;#039;Premium-Eras-canon.png&amp;#039;,&lt;br /&gt;
			tooltip = &amp;#039;This article details a subject that is considered canon.&amp;#039;,&lt;br /&gt;
			link = &amp;#039;Canon&amp;#039;&lt;br /&gt;
		}&lt;br /&gt;
		if isUsingCategory then&lt;br /&gt;
			data.category = &amp;#039;Canon articles&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		return self:renderIcon(data)&lt;br /&gt;
	elseif continuity == &amp;#039;legends&amp;#039; then&lt;br /&gt;
		local data = {&lt;br /&gt;
			image = &amp;#039;Premium-Eras-legends.png&amp;#039;,&lt;br /&gt;
			tooltip = &amp;#039;This article details a subject that falls under the Legends brand.&amp;#039;,&lt;br /&gt;
			link = &amp;#039;Star Wars Legends&amp;#039;&lt;br /&gt;
		}&lt;br /&gt;
		if isUsingCategory then&lt;br /&gt;
			data.category = &amp;#039;Legends articles&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		return self:renderIcon(data)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Renders the icons that respond to a publishing era.&lt;br /&gt;
function Eras:renderPublishingIcons()&lt;br /&gt;
	if self.continuityOverride ~= &amp;#039;canon&amp;#039;&lt;br /&gt;
		and not self.legendsArticle&lt;br /&gt;
		and not self:hasCanonTitle()&lt;br /&gt;
	then&lt;br /&gt;
		local ret = {}&lt;br /&gt;
		local codes = {&amp;#039;pre&amp;#039;, &amp;#039;btr&amp;#039;, &amp;#039;old&amp;#039;, &amp;#039;imp&amp;#039;, &amp;#039;reb&amp;#039;, &amp;#039;new&amp;#039;, &amp;#039;njo&amp;#039;, &amp;#039;leg&amp;#039;, &amp;#039;inf&amp;#039;}&lt;br /&gt;
		for _, code in ipairs(codes) do&lt;br /&gt;
			local data = self:getIconData(code)&lt;br /&gt;
			if data then&lt;br /&gt;
				ret[#ret + 1] = self:renderIcon(data)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return table.concat(ret)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Renders other icons, e.g. featured article status and protection status.&lt;br /&gt;
function Eras:renderNonPublishingIcons()&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	local codes = {&amp;#039;real&amp;#039;, &amp;#039;featured&amp;#039;, &amp;#039;former&amp;#039;, &amp;#039;good&amp;#039;, &amp;#039;fga&amp;#039;, &amp;#039;comp&amp;#039;, &amp;#039;fca&amp;#039;}&lt;br /&gt;
	for _, code in ipairs(codes) do&lt;br /&gt;
		local data = self:getIconData(code)&lt;br /&gt;
		if data then&lt;br /&gt;
			ret[#ret + 1] = self:renderIcon(data)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local protectionCodes = {&amp;#039;fprot&amp;#039;, &amp;#039;sprot&amp;#039;, &amp;#039;ssprot&amp;#039;, &amp;#039;mprot&amp;#039;, &amp;#039;uprot&amp;#039;}&lt;br /&gt;
	for _, code in ipairs(protectionCodes) do&lt;br /&gt;
		local data = self:getIconData(code)&lt;br /&gt;
		if data then&lt;br /&gt;
			ret[#ret + 1] = self:renderProtectionIcon(data)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(ret)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Render all the icons and eclose them in a surrounding div tag.&lt;br /&gt;
function Eras:renderIcons()&lt;br /&gt;
	local icons = {}&lt;br /&gt;
	icons[#icons + 1] = self:renderContinuityIcon()&lt;br /&gt;
	icons[#icons + 1] = self:renderPublishingIcons()&lt;br /&gt;
	icons[#icons + 1] = self:renderNonPublishingIcons()&lt;br /&gt;
	icons = table.concat(icons)&lt;br /&gt;
&lt;br /&gt;
	local root = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	root&lt;br /&gt;
		:attr(&amp;#039;id&amp;#039;, &amp;#039;title-eraicons&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;float&amp;#039;, &amp;#039;right&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;position&amp;#039;, &amp;#039;static&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;display&amp;#039;, &amp;#039;none&amp;#039;)&lt;br /&gt;
		:wikitext(icons)&lt;br /&gt;
&lt;br /&gt;
	return tostring(root)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Renders the Canon and Legends tabs for articles that are in both&lt;br /&gt;
-- continuities.&lt;br /&gt;
function Eras:renderCanonTab()&lt;br /&gt;
	if self.isHidden or self.title.namespace ~= 0 then&lt;br /&gt;
		-- Exit if we have been explicitly hidden or if we are not in the main&lt;br /&gt;
		-- namespace.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Find the page type, canon title, and legends title.&lt;br /&gt;
	local pageType, canonTitle, legendsTitle&lt;br /&gt;
	if self.legendsArticle then&lt;br /&gt;
		pageType = &amp;#039;canon&amp;#039;&lt;br /&gt;
		canonTitle = self.title.text&lt;br /&gt;
		legendsTitle = self.legendsArticle&lt;br /&gt;
	elseif self.canonArticle then&lt;br /&gt;
		pageType = &amp;#039;legends&amp;#039;&lt;br /&gt;
		canonTitle = self.canonArticle&lt;br /&gt;
		legendsTitle = self.title.text&lt;br /&gt;
	elseif self:hasCanonTitle() then&lt;br /&gt;
		pageType = &amp;#039;canon&amp;#039;&lt;br /&gt;
		canonTitle = self.title.text&lt;br /&gt;
		legendsTitle = canonTitle:match(&amp;#039;^(.*)/Canon$&amp;#039;) or canonTitle&lt;br /&gt;
	elseif self:hasLegendsTitle() then&lt;br /&gt;
		pageType = &amp;#039;legends&amp;#039;&lt;br /&gt;
		legendsTitle = self.title.text&lt;br /&gt;
		canonTitle = legendsTitle:match(&amp;#039;^(.*)/Legends$&amp;#039;) or legendsTitle&lt;br /&gt;
	elseif exists(self.title.text .. &amp;#039;/Legends&amp;#039;) then&lt;br /&gt;
		pageType = &amp;#039;canon&amp;#039;&lt;br /&gt;
		legendsTitle = self.title.text .. &amp;#039;/Legends&amp;#039;&lt;br /&gt;
		canonTitle = self.title.text&lt;br /&gt;
	elseif exists(self.title.text .. &amp;#039;/Canon&amp;#039;) then&lt;br /&gt;
		pageType = &amp;#039;legends&amp;#039;&lt;br /&gt;
		canonTitle = self.title.text .. &amp;#039;/Canon&amp;#039;&lt;br /&gt;
		legendsTitle = self.title.text&lt;br /&gt;
	else&lt;br /&gt;
		-- Could not determine that the article has both a Canon and a Legends&lt;br /&gt;
		-- version, so exit.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if self:hasCanonTitle() then&lt;br /&gt;
		self:addCategory(&amp;#039;Articles with /Canon&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add categories.&lt;br /&gt;
	if pageType == &amp;#039;canon&amp;#039; then&lt;br /&gt;
		self:addCategory(&amp;#039;Canon articles with Legends counterparts&amp;#039;)&lt;br /&gt;
	elseif pageType == &amp;#039;legends&amp;#039; then&lt;br /&gt;
		self:addCategory(&amp;#039;Legends articles with canon counterparts&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		self:addCategory(&amp;#039;Outliers&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
	-- Make the table root.&lt;br /&gt;
	local root = mw.html.create(&amp;#039;table&amp;#039;)&lt;br /&gt;
	root&lt;br /&gt;
		:attr(&amp;#039;id&amp;#039;, &amp;#039;canontab&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;text-align&amp;#039;, &amp;#039;center&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;padding&amp;#039;, &amp;#039;0&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;margin&amp;#039;, &amp;#039;0 0 5px 0&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;border-left&amp;#039;, &amp;#039;0&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;border-right&amp;#039;, &amp;#039;0&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;border-top&amp;#039;, &amp;#039;0&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;border-bottom&amp;#039;, &amp;#039;7px solid #002e54&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;border-spacing&amp;#039;, &amp;#039;0&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;border-collapse&amp;#039;, &amp;#039;collapse&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;width&amp;#039;, &amp;#039;100%&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;vertical-align&amp;#039;, &amp;#039;top&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
	local row = root:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
	-- This makes one Canon/Legends cell. Having this as a function rather than&lt;br /&gt;
	-- doing it with chaining allows us to avoid putting the same code in twice.&lt;br /&gt;
	local function makeCell(id, color, image, link, tooltip)&lt;br /&gt;
		local cell = mw.html.create(&amp;#039;td&amp;#039;)&lt;br /&gt;
		cell&lt;br /&gt;
			:attr(&amp;#039;id&amp;#039;, id)&lt;br /&gt;
			:css(&amp;#039;padding&amp;#039;, &amp;#039;0 0 5px 0&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;background-color&amp;#039;, color)&lt;br /&gt;
			:css(&amp;#039;line-height&amp;#039;, &amp;#039;0.95em&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;font-size&amp;#039;, &amp;#039;150%&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;font-weight&amp;#039;, &amp;#039;bold&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;width&amp;#039;, &amp;#039;20px&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;vertical-align&amp;#039;, &amp;#039;top&amp;#039;)&lt;br /&gt;
			:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
				:addClass(&amp;#039;content-bg rtop&amp;#039;)&lt;br /&gt;
				:css(&amp;#039;background&amp;#039;, &amp;#039;#ffffff&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
					:addClass(&amp;#039;r1&amp;#039;)&lt;br /&gt;
					:css(&amp;#039;background&amp;#039;, color)&lt;br /&gt;
					:done()&lt;br /&gt;
				:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
					:addClass(&amp;#039;r2&amp;#039;)&lt;br /&gt;
					:css(&amp;#039;background&amp;#039;, color)&lt;br /&gt;
					:done()&lt;br /&gt;
				:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
					:addClass(&amp;#039;r3&amp;#039;)&lt;br /&gt;
					:css(&amp;#039;background&amp;#039;, color)&lt;br /&gt;
					:done()&lt;br /&gt;
				:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
					:addClass(&amp;#039;r4&amp;#039;)&lt;br /&gt;
					:css(&amp;#039;background&amp;#039;, color)&lt;br /&gt;
					:done()&lt;br /&gt;
				:done()&lt;br /&gt;
			:wikitext(string.format(&lt;br /&gt;
				&amp;#039; [[File:%s|link=%s|%s]]&amp;#039;,&lt;br /&gt;
				image, link, tooltip&lt;br /&gt;
			))&lt;br /&gt;
		return cell&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local foregroundColor = &amp;#039;#002e54&amp;#039;&lt;br /&gt;
	local backgroundColor = &amp;#039;#d8e9fc&amp;#039;&lt;br /&gt;
&lt;br /&gt;
	-- Make the canon cell.&lt;br /&gt;
	do&lt;br /&gt;
		local id = &amp;#039;canontab-canon&amp;#039;&lt;br /&gt;
		local link = canonTitle&lt;br /&gt;
		local color, image, tooltip&lt;br /&gt;
		if pageType == &amp;#039;canon&amp;#039; then&lt;br /&gt;
			color = foregroundColor&lt;br /&gt;
			image = &amp;#039;Tab-canon-white.png&amp;#039;&lt;br /&gt;
			tooltip = &amp;#039;This article covers the Canon version of this subject.&amp;#039;&lt;br /&gt;
		else&lt;br /&gt;
			color = backgroundColor&lt;br /&gt;
			image = &amp;#039;Tab-canon-black.png&amp;#039;&lt;br /&gt;
			tooltip = &amp;quot;Click here for Wookieepedia&amp;#039;s article on the Canon &amp;quot; ..&lt;br /&gt;
				&amp;quot;version of this subject.&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		row:node(makeCell(id, color, image, link, tooltip))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- First separator cell&lt;br /&gt;
	row:tag(&amp;#039;td&amp;#039;)&lt;br /&gt;
		:attr(&amp;#039;id&amp;#039;, &amp;#039;canontab-separator1&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;width&amp;#039;, &amp;#039;3px&amp;#039;)&lt;br /&gt;
		:wikitext(&amp;#039;&amp;amp;nbsp;&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	-- Make the legends cell&lt;br /&gt;
	do&lt;br /&gt;
		local id = &amp;#039;canontab-legends&amp;#039;&lt;br /&gt;
		local link = legendsTitle&lt;br /&gt;
		local color, image, tooltip&lt;br /&gt;
		if pageType ~= &amp;#039;canon&amp;#039; then -- is a Legends page&lt;br /&gt;
			color = foregroundColor&lt;br /&gt;
			image = &amp;#039;Tab-legends-white.png&amp;#039;&lt;br /&gt;
			tooltip = &amp;#039;This article covers the Legends version of this subject.&amp;#039;&lt;br /&gt;
		else -- is a Canon page&lt;br /&gt;
			color = backgroundColor&lt;br /&gt;
			image = &amp;#039;Tab-legends-black.png&amp;#039;&lt;br /&gt;
			tooltip = &amp;quot;Click here for Wookieepedia&amp;#039;s article on the Legends &amp;quot; ..&lt;br /&gt;
				&amp;quot;version of this subject.&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		row:node(makeCell(id, color, image, link, tooltip))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Second separator cell&lt;br /&gt;
	row:tag(&amp;#039;td&amp;#039;)&lt;br /&gt;
		:attr(&amp;#039;id&amp;#039;, &amp;#039;canontab-separator2&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;width&amp;#039;, &amp;#039;3000px&amp;#039;)&lt;br /&gt;
		:wikitext(&amp;#039;&amp;amp;nbsp;&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	return tostring(root)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Render all the categories that were specified using Eras:addCategory or with&lt;br /&gt;
-- category flags.&lt;br /&gt;
function Eras:renderCategories()&lt;br /&gt;
	local fullPagename = self.title.prefixedText&lt;br /&gt;
	if fullPagename == &amp;#039;Template:Eras&amp;#039; or fullPagename == &amp;#039;Template:Eraicon&amp;#039; then&lt;br /&gt;
		-- Exit if we are on a blacklisted page.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local pagename = self.title.text&lt;br /&gt;
&lt;br /&gt;
	-- Renders one category.&lt;br /&gt;
	local function renderCategory(cat, sort)&lt;br /&gt;
		return string.format(&lt;br /&gt;
			&amp;#039;[[%s:%s|%s]]&amp;#039;, &amp;#039;Category&amp;#039;, cat, sort or pagename&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ret = {}&lt;br /&gt;
&lt;br /&gt;
	-- Render categories from Eras:addCategory&lt;br /&gt;
	for i, t in ipairs(self.categories) do&lt;br /&gt;
		ret[i] = renderCategory(t.category, t.sortKey)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Render categories from category flags.&lt;br /&gt;
	if self.hasBadParameter then&lt;br /&gt;
		ret[#ret + 1] = renderCategory(&lt;br /&gt;
			&amp;#039;Pages with bad parameters in Template:Eras&amp;#039;&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
	if self.hasIncorrectProtectionIcon then&lt;br /&gt;
		ret[#ret + 1] = renderCategory(&lt;br /&gt;
			&amp;#039;Pages with incorrect protection icons&amp;#039;&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return table.concat(ret)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Add __NOTOC__ if needed&lt;br /&gt;
function Eras:renderNotoc()&lt;br /&gt;
	if self.hideToc then&lt;br /&gt;
		return &amp;#039;__NOTOC__&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This method is called when the tostring function is used on the Eras object.&lt;br /&gt;
-- (This works in a similar fashion to Eras.__index above.) It calls all the&lt;br /&gt;
-- top-level render methods and returns the final output.&lt;br /&gt;
function Eras:__tostring()&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	ret[#ret + 1] = self:renderDisplayTitle()&lt;br /&gt;
	ret[#ret + 1] = self:renderIcons()&lt;br /&gt;
	ret[#ret + 1] = self:renderCanonTab()&lt;br /&gt;
	ret[#ret + 1] = self:renderCategories()&lt;br /&gt;
	ret[#ret + 1] = self:renderNotoc()&lt;br /&gt;
	return table.concat(ret)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Exports&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- This function is the entry point from other Lua modules.&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	-- Define a function to call from pcall so that we can catch any errors&lt;br /&gt;
	-- and display them to the user rather than the cryptic &amp;quot;Script error&amp;quot;.&lt;br /&gt;
	-- (It&amp;#039;s not so cryptic if you click on it to see the error message, but&lt;br /&gt;
	-- not so many users know to do that.)&lt;br /&gt;
	local function getErasResult ()&lt;br /&gt;
		local erasObj = Eras.new(args)&lt;br /&gt;
		-- Temporary hack to hide ugly error message on LEGO articles&lt;br /&gt;
		if erasObj == false then&lt;br /&gt;
			return &amp;#039;[[&amp;#039; .. &amp;#039;Category:Pages with bad parameters in Template:Eras]]&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		return tostring(erasObj)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Get the result. We only catch errors if debug mode is set to false.&lt;br /&gt;
	local success, result&lt;br /&gt;
	if DEBUG_MODE then&lt;br /&gt;
		success = true&lt;br /&gt;
		result = getErasResult()&lt;br /&gt;
	else&lt;br /&gt;
		success, result = pcall(getErasResult)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Return the result if there were no errors, and a formatted error message &lt;br /&gt;
	-- if there were.&lt;br /&gt;
	if success then&lt;br /&gt;
		return result&lt;br /&gt;
	else&lt;br /&gt;
		return string.format(&lt;br /&gt;
			&amp;#039;&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;[[Template:Eras]] error: %s.&amp;lt;/strong&amp;gt;&amp;#039; ..&lt;br /&gt;
			&amp;#039;[[&amp;#039; .. &amp;#039;Category:Pages with bad parameters in Template:Eras]]&amp;#039;,&lt;br /&gt;
			result -- this is the error message&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This is the function accessed from wikitext. It must be accessed through&lt;br /&gt;
-- a template. The template should transclude only the text&lt;br /&gt;
-- &amp;quot;{{#invoke:Eras|main}}&amp;quot;, and then when that template is used, any arguments&lt;br /&gt;
-- passed to it are magically sent through to the module.&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = {}&lt;br /&gt;
	for k, v in pairs(frame:getParent().args) do&lt;br /&gt;
		v = v:match(&amp;#039;^%s*(.-)%s*$&amp;#039;) -- trim whitespace&lt;br /&gt;
		if v ~= &amp;#039;&amp;#039; then&lt;br /&gt;
			args[k] = v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return p._main(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;br /&gt;
&lt;br /&gt;
-- &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
-- [[Category:Eras utility templates|{{PAGENAME}}]]&lt;/div&gt;</summary>
		<author><name>Drl-admin</name></author>
	</entry>
</feed>