<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FGonnym%2Fsometest3%2F1</id>
	<title>Module:Sandbox/Gonnym/sometest3/1 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FGonnym%2Fsometest3%2F1"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Gonnym/sometest3/1&amp;action=history"/>
	<updated>2026-05-26T08:43:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Sandbox/Gonnym/sometest3/1&amp;diff=145486&amp;oldid=prev</id>
		<title>imported&gt;Gonnym at 10:05, 8 July 2019</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Gonnym/sometest3/1&amp;diff=145486&amp;oldid=prev"/>
		<updated>2019-07-08T10:05:28Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- TODO: currently unused.&lt;br /&gt;
-- local GENERAL_CATEGORY_CHARACTER = &amp;quot;[[Category:{} character redirects]]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
local mainRedirect = true&lt;br /&gt;
local printworthy = true&lt;br /&gt;
local redirectTemplates = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
--[[ &lt;br /&gt;
Local function which handles the addition of redirect templates.&lt;br /&gt;
--]]&lt;br /&gt;
local function addRedirectTemplate(redirectTemplate)&lt;br /&gt;
	redirectTemplates = redirectTemplates .. redirectTemplate&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[ TODO: currently unused.&lt;br /&gt;
Local function which handles the addition of character redirects&lt;br /&gt;
that don&amp;#039;t belong in the &amp;quot;to lists&amp;quot; category.&lt;br /&gt;
local function addToGeneralCharacterCategory(categories, series)&lt;br /&gt;
	categories = categories .. GENERAL_CATEGORY_CHARACTER:gsub(&amp;quot;{}&amp;quot;, series)&lt;br /&gt;
	return categories&lt;br /&gt;
end--]]&lt;br /&gt;
&lt;br /&gt;
--[[ &lt;br /&gt;
Local function which handles the R from fictional character/element/location redirect template&lt;br /&gt;
for multiple series tags for a single topic.&lt;br /&gt;
This is used for example on Arrowverse or Marvel Cinematic Universe topics.&lt;br /&gt;
--]]&lt;br /&gt;
local function addToRFromFictionalObjectMulti(objectType, frame, argsTable)&lt;br /&gt;
	if (type(elem) == &amp;quot;table&amp;quot;) then&lt;br /&gt;
		argsTable[&amp;quot;multi&amp;quot;] = &amp;quot;yes&amp;quot;&lt;br /&gt;
		addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R from fictional &amp;#039; .. objectType, args = argsTable})&lt;br /&gt;
	else&lt;br /&gt;
		error(&amp;quot;|multi_series= can only be used in other modules&amp;quot;, 0)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[ &lt;br /&gt;
Local function which handles the R from fictional character/element/location redirect template&lt;br /&gt;
for a single series tag.&lt;br /&gt;
--]]&lt;br /&gt;
local function addToRFromFictionalObjectSingle(objectType, frame, series)&lt;br /&gt;
	addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R from fictional &amp;#039; .. objectType, args = {series}})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[ &lt;br /&gt;
Local function which checks if the redirect is tagged with a single series or multiple series.&lt;br /&gt;
--]]&lt;br /&gt;
local function addToRFromFictionalObject(objectType, frame, args)&lt;br /&gt;
	if (args.multi_series) then&lt;br /&gt;
		addToRFromFictionalObjectMulti(objectType, frame, args.multi_series)&lt;br /&gt;
	else&lt;br /&gt;
		addToRFromFictionalObjectSingle(objectType, frame, args.series)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[ &lt;br /&gt;
Local function which handles all the shared character, element and location redirect handling code.&lt;br /&gt;
--]]&lt;br /&gt;
local function sharedRedirects(objectType, frame, args)&lt;br /&gt;
	if (args.alt_spelling) then&lt;br /&gt;
		addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R from alternative spelling&amp;#039;, args = {args.alt_spelling}})&lt;br /&gt;
		printworthy = false&lt;br /&gt;
		mainRedirect = false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (args.anchor) then&lt;br /&gt;
		addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R to anchor 2&amp;#039;})&lt;br /&gt;
	elseif (args.list) then&lt;br /&gt;
		addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R to list entry&amp;#039;})	&lt;br /&gt;
	elseif (args.not_list) then&lt;br /&gt;
		-- Do nothing atm.&lt;br /&gt;
	else&lt;br /&gt;
		addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R to section&amp;#039;})	&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (args.primary) then&lt;br /&gt;
		addRedirectTemplate(&amp;quot;\n&amp;quot; .. frame:expandTemplate{title = &amp;#039;R avoided double redirect&amp;#039;, args = {args.primary}})&lt;br /&gt;
		mainRedirect = false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (args.incorrect_name) then&lt;br /&gt;
		addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R from incorrect name&amp;#039;, args = {args.incorrect_name}})&lt;br /&gt;
		mainRedirect = false&lt;br /&gt;
		printworthy = false&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if (args.unneeded_dab) then&lt;br /&gt;
		addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R from unnecessary disambiguation&amp;#039;})&lt;br /&gt;
		mainRedirect = false&lt;br /&gt;
		printworthy = false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (args.dab_exception) then&lt;br /&gt;
		if (mainRedirect) then&lt;br /&gt;
			addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R with possibilities&amp;#039;})&lt;br /&gt;
		end&lt;br /&gt;
			&lt;br /&gt;
		addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R printworthy&amp;#039;})&lt;br /&gt;
	else&lt;br /&gt;
		local match = require(&amp;quot;Module:String&amp;quot;)._match&lt;br /&gt;
		local title = mw.title.getCurrentTitle().text&lt;br /&gt;
		local disambiguation = match(title, &amp;quot;%s%((.-)%)&amp;quot;, 1, -1, false, &amp;quot;&amp;quot;)&lt;br /&gt;
		&lt;br /&gt;
		local correctDisambiguation = &amp;quot;&amp;quot;&lt;br /&gt;
		if (args.correct_disambiguation) then&lt;br /&gt;
			correctDisambiguation = args.correct_disambiguation&lt;br /&gt;
		elseif (args.series) then&lt;br /&gt;
			correctDisambiguation = string.gsub(args.series, &amp;quot;%(.*%)&amp;quot;, &amp;quot;&amp;quot;, 1)&lt;br /&gt;
			correctDisambiguation = mw.text.trim(correctDisambiguation)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if (not disambiguation or disambiguation == &amp;quot;&amp;quot; or&lt;br /&gt;
			disambiguation == correctDisambiguation or disambiguation == correctDisambiguation .. &amp;quot; &amp;quot; .. objectType) then&lt;br /&gt;
&lt;br /&gt;
			if (mainRedirect) then&lt;br /&gt;
				addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R with possibilities&amp;#039;})&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			if (printworthy) then&lt;br /&gt;
				addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R printworthy&amp;#039;})&lt;br /&gt;
			else&lt;br /&gt;
				addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R unprintworthy&amp;#039;})&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R from incorrect disambiguation&amp;#039;})&lt;br /&gt;
			addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R unprintworthy&amp;#039;})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return frame:expandTemplate{title = &amp;#039;Redirect category shell&amp;#039;, args = {redirectTemplates}}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[ &lt;br /&gt;
Public function from other modules.&lt;br /&gt;
Function handles the unique character redirect code.&lt;br /&gt;
--]]&lt;br /&gt;
function p._character(frame, args)&lt;br /&gt;
	addToRFromFictionalObject(&amp;quot;character&amp;quot;, frame, args)&lt;br /&gt;
&lt;br /&gt;
	if (args.alt_name) then&lt;br /&gt;
		addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R comics from alternative name&amp;#039;})&lt;br /&gt;
		mainRedirect = false&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if (args.nickname) then&lt;br /&gt;
		addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R from alternative name&amp;#039;})&lt;br /&gt;
		mainRedirect = false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (args.short_name) then&lt;br /&gt;
		addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R from short name&amp;#039;})&lt;br /&gt;
		mainRedirect = false&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if (args.long_name) then&lt;br /&gt;
		addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R from long name&amp;#039;})&lt;br /&gt;
		mainRedirect = false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (args.title_name) then&lt;br /&gt;
		addRedirectTemplate(frame:expandTemplate{title = &amp;#039;R from name with title&amp;#039;})&lt;br /&gt;
		printworthy = false&lt;br /&gt;
		mainRedirect = false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return sharedRedirects(&amp;quot;character&amp;quot;, frame, args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[ &lt;br /&gt;
Public function from other modules.&lt;br /&gt;
Function handles the unique element redirect code.&lt;br /&gt;
Do not merge with other sections to allow for future changes.&lt;br /&gt;
--]]&lt;br /&gt;
function p._element(frame, args)&lt;br /&gt;
	addToRFromFictionalObject(&amp;quot;element&amp;quot;, frame, args)&lt;br /&gt;
	return sharedRedirects(&amp;quot;element&amp;quot;, frame, args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[ &lt;br /&gt;
Public function from other modules.&lt;br /&gt;
Function handles the unique location redirect code.&lt;br /&gt;
Do not merge with other sections to allow for future changes.&lt;br /&gt;
--]]&lt;br /&gt;
function p._location(frame, args)&lt;br /&gt;
	addToRFromFictionalObject(&amp;quot;location&amp;quot;, frame, args)&lt;br /&gt;
	return sharedRedirects(&amp;quot;location&amp;quot;, frame, args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Public function which is used to create a Redirect category shell&lt;br /&gt;
with relevant redirects for fictional character redirects.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
	-- |series=					— required; The name of the series article, including disambiguation. Will set the value entered as series which this object belongs to.&lt;br /&gt;
	-- |multi_series=			— optional; Multiple series article names, including disambiguation. Will set the values entered as series which this object belongs to.&lt;br /&gt;
										This parameter can only be used from other modules as it requires the parameters to be passed as an args table.&lt;br /&gt;
	-- |alt_name=				— optional; Only valid for characters; Any value will tag the redirect with: &amp;quot;R comics from alternative name&amp;quot;.&lt;br /&gt;
	-- |nickname=				— optional; Only valid for characters; Any value will tag the redirect with: &amp;quot;R from alternative name&amp;quot;.&lt;br /&gt;
	-- |short_name=				— optional; Only valid for characters; Any value will tag the redirect with: &amp;quot;R from short name&amp;quot;.&lt;br /&gt;
	-- |long_name=				— optional; Only valid for characters; Any value will tag the redirect with: &amp;quot;R from long name&amp;quot;.&lt;br /&gt;
	-- |title_name=				— optional; Only valid for characters; Any value will tag the redirect with: &amp;quot;R from name with title&amp;quot;.&lt;br /&gt;
	-- |alt_spelling=			— optional; Will tag the redirect with: &amp;quot;R from alternative spelling&amp;quot; and set the value entered as the correct spelling to use.&lt;br /&gt;
	-- |anchor=					— optional; Any value will tag the redirect with: &amp;quot;R to anchor&amp;quot;.&lt;br /&gt;
	-- |list=					— optional; Any value will tag the redirect with: &amp;quot;R to list entry&amp;quot;.&lt;br /&gt;
	-- |primary=				— optional; Will tag the redirect with: &amp;quot;R avoided double redirect&amp;quot; and set the value entered as the primary redirect.&lt;br /&gt;
	-- |incorrect_name=			— optional; Will tag the redirect with: &amp;quot;R from incorrect name&amp;quot; and set the value entered as the correct name to use.&lt;br /&gt;
	-- |unneeded_dab=			— optional; Any value will tag the redirect with: &amp;quot;R from unnecessary disambiguation&amp;quot;.	&lt;br /&gt;
	-- |dab_exception=			— optional; Any value will tag the redirect with: &amp;quot;R with possibilities&amp;quot; and &amp;quot;R printworthy&amp;quot;, regardless of other issues the redirect might have.&lt;br /&gt;
										Using this parameter will ignore notes C, D and F below.&lt;br /&gt;
	-- |not_list=				— optional; Only valid for characters; Any value will disable the normal &amp;quot;R from fictional character&amp;quot; tagging&lt;br /&gt;
										and place the redirect directly in a general &amp;quot;(series) character redirects&amp;quot; category.&lt;br /&gt;
	-- |correct_disambiguation= — optional; Value will be used for disambiguation validation.&lt;br /&gt;
										Should be used if the disambiguation is different than the series name, such as when using a franchise name.&lt;br /&gt;
	&lt;br /&gt;
Notes:&lt;br /&gt;
	-- A: The redirect will automatically be tagged with &amp;quot;R from fictional character&amp;quot;, &amp;quot;R from fictional element&amp;quot; or &amp;quot;R from fictional location&amp;quot;,&lt;br /&gt;
			depending on the function used.&lt;br /&gt;
	-- B: Using the series parameter will place the redirect in a series-specific category: &amp;quot;(series) (object) redirects to lists&amp;quot;.&lt;br /&gt;
	-- C: If one of the following parameters is used — |alt_name=, |short_name=, |long_name=, |alt_spelling=, |primary= or |incorrect_name= —&lt;br /&gt;
			the redirect will not be tagged with &amp;quot;R with possibilities&amp;quot;.&lt;br /&gt;
	-- D: If one of the following parameters is used — |alt_spelling= or |incorrect_name= —&lt;br /&gt;
			the redirect will be tagged with &amp;quot;R unprintworthy&amp;quot;, else it will be tagged with &amp;quot;R printworthy&amp;quot;.&lt;br /&gt;
	-- E: If the |anchor= or |list= parameters are not used, the redirect will be tagged with &amp;quot;R to section&amp;quot;.&lt;br /&gt;
	&lt;br /&gt;
--]]&lt;br /&gt;
function p.character(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	return p._character(frame, args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Public function which is used to create a Redirect category shell&lt;br /&gt;
with relevant redirects for fictional element redirects.&lt;br /&gt;
&lt;br /&gt;
Parameters: See character() for documentation.&lt;br /&gt;
--]]&lt;br /&gt;
function p.element(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	return p._element(frame, args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Public function which is used to create a Redirect category shell&lt;br /&gt;
with relevant redirects for fictional location redirects.&lt;br /&gt;
&lt;br /&gt;
Parameters: See character() for documentation.&lt;br /&gt;
--]]&lt;br /&gt;
function p.location(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	return p._location(frame, args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Gonnym</name></author>
	</entry>
</feed>