<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.tachyony.co.uk/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AJcttop%2Fcore</id>
	<title>Module:Jcttop/core - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tachyony.co.uk/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AJcttop%2Fcore"/>
	<link rel="alternate" type="text/html" href="https://wiki.tachyony.co.uk/w/index.php?title=Module:Jcttop/core&amp;action=history"/>
	<updated>2026-05-15T15:01:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.5</generator>
	<entry>
		<id>https://wiki.tachyony.co.uk/w/index.php?title=Module:Jcttop/core&amp;diff=6558&amp;oldid=prev</id>
		<title>Tachyony: Created page with &quot;local p = {}  local format = string.format -- Local version of string formatting function  local function hatnote(args) 	local insert = table.insert 	local text = {args.region_note} 	local tense 	 	local hatnoteArg = args.hatnote 	if hatnoteArg == &#039;off&#039; then 		insert(text, &#039;&#039;) 	elseif hatnoteArg then 		insert(text, hatnoteArg .. &quot;&amp;nbsp;&quot;) 	else 		local indep_city = args.indep_city 		local sub1 = args.sub1 		local sub2 = args.sub2 		if indep_city or sub1 or sub2 then 			l...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.tachyony.co.uk/w/index.php?title=Module:Jcttop/core&amp;diff=6558&amp;oldid=prev"/>
		<updated>2022-01-19T13:49:41Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local p = {}  local format = string.format -- Local version of string formatting function  local function hatnote(args) 	local insert = table.insert 	local text = {args.region_note} 	local tense 	 	local hatnoteArg = args.hatnote 	if hatnoteArg == &amp;#039;off&amp;#039; then 		insert(text, &amp;#039;&amp;#039;) 	elseif hatnoteArg then 		insert(text, hatnoteArg .. &amp;quot; &amp;quot;) 	else 		local indep_city = args.indep_city 		local sub1 = args.sub1 		local sub2 = args.sub2 		if indep_city or sub1 or sub2 then 			l...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
local format = string.format -- Local version of string formatting function&lt;br /&gt;
&lt;br /&gt;
local function hatnote(args)&lt;br /&gt;
	local insert = table.insert&lt;br /&gt;
	local text = {args.region_note}&lt;br /&gt;
	local tense&lt;br /&gt;
	&lt;br /&gt;
	local hatnoteArg = args.hatnote&lt;br /&gt;
	if hatnoteArg == &amp;#039;off&amp;#039; then&lt;br /&gt;
		insert(text, &amp;#039;&amp;#039;)&lt;br /&gt;
	elseif hatnoteArg then&lt;br /&gt;
		insert(text, hatnoteArg .. &amp;quot;&amp;amp;nbsp;&amp;quot;)&lt;br /&gt;
	else&lt;br /&gt;
		local indep_city = args.indep_city&lt;br /&gt;
		local sub1 = args.sub1&lt;br /&gt;
		local sub2 = args.sub2&lt;br /&gt;
		if indep_city or sub1 or sub2 then&lt;br /&gt;
			local region = args.region&lt;br /&gt;
			tense = args.former == &amp;#039;yes&amp;#039;&lt;br /&gt;
			local verb = tense and &amp;#039;was&amp;#039; or &amp;#039;is&amp;#039;&lt;br /&gt;
			insert(text, format(&amp;quot;The entire %s %s in &amp;quot;, args.type or &amp;#039;route&amp;#039;, verb))&lt;br /&gt;
			if indep_city then&lt;br /&gt;
				insert(text, format(&amp;quot;[[%s, %s|%s]]&amp;quot;, indep_city, region, indep_city))&lt;br /&gt;
			else&lt;br /&gt;
				local sub1name = args.sub1name&lt;br /&gt;
				if sub2 then&lt;br /&gt;
					insert(text, &amp;quot;[[&amp;quot; .. sub2)&lt;br /&gt;
					local area = args.area&lt;br /&gt;
					if area then&lt;br /&gt;
						insert(text, format(&amp;quot; (%s)&amp;quot;, area))&lt;br /&gt;
					end&lt;br /&gt;
					if args.sub1dab == &amp;#039;yes&amp;#039; then&lt;br /&gt;
						insert(text, format(&amp;quot;, %s %s&amp;quot;, sub1, sub1name))&lt;br /&gt;
					end&lt;br /&gt;
					insert(text, format(&amp;quot;, %s|%s]]&amp;quot;, region, sub2))&lt;br /&gt;
				end&lt;br /&gt;
				if sub1 then&lt;br /&gt;
					if sub2 then&lt;br /&gt;
						insert(text, &amp;#039;, &amp;#039;)&lt;br /&gt;
					end&lt;br /&gt;
					insert(text, format(&amp;quot;[[%s %s, %s|%s %s]]&amp;quot;, sub1, sub1name, region, sub1, sub1name))&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		insert(text, &amp;#039;. &amp;#039;)&lt;br /&gt;
		insert(text, args.sub1_ref)&lt;br /&gt;
		insert(text, args.sub2_ref)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if args.unnum == &amp;#039;yes&amp;#039; then&lt;br /&gt;
		insert(text, format(&amp;quot;All exits %s unnumbered.&amp;quot;, tense and &amp;#039;were&amp;#039; or &amp;#039;are&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return mw.text.trim(table.concat(text))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function header(args)&lt;br /&gt;
	local row = mw.html.create(&amp;#039;tr&amp;#039;)&lt;br /&gt;
	local region_col = args.region_col&lt;br /&gt;
	if region_col then&lt;br /&gt;
		row:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;scope&amp;#039;, &amp;#039;col&amp;#039;):wikitext(mw.language.getContentLanguage():ucfirst(region_col))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local indep_city = args.indep_city&lt;br /&gt;
	if not(args.nosub1 == &amp;#039;yes&amp;#039; or args.sub1 or indep_city) then&lt;br /&gt;
		local tag = row:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;scope&amp;#039;, &amp;#039;col&amp;#039;)&lt;br /&gt;
		local sub1disp = args.sub1disp&lt;br /&gt;
		if sub1disp then&lt;br /&gt;
			tag:wikitext(sub1disp)&lt;br /&gt;
		else&lt;br /&gt;
			tag:wikitext(args.sub1name):wikitext(args.sub1_ref)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if not(args.sub2 or indep_city) then&lt;br /&gt;
		row:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;scope&amp;#039;, &amp;#039;col&amp;#039;)&lt;br /&gt;
			:wikitext(args.location_def or &amp;#039;Location&amp;#039;):wikitext(args.sub2_ref)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local altunit = args.altunit&lt;br /&gt;
	if altunit then&lt;br /&gt;
		row:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;scope&amp;#039;, &amp;#039;col&amp;#039;):wikitext(altunit):wikitext(args.altunit_ref)&lt;br /&gt;
	else&lt;br /&gt;
		local unit = args.length or args.unit&lt;br /&gt;
		if unit ~= &amp;#039;off&amp;#039; then&lt;br /&gt;
			row:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;scope&amp;#039;, &amp;#039;col&amp;#039;):wikitext(unit):wikitext(args.length_ref):done():tag(&amp;#039;th&amp;#039;):attr(&amp;#039;scope&amp;#039;, &amp;#039;col&amp;#039;):wikitext(args.unit2)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local exit = args[1]&lt;br /&gt;
	if exit == &amp;#039;old&amp;#039; then&lt;br /&gt;
		row:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;scope&amp;#039;, &amp;#039;col&amp;#039;):wikitext(args.old_def or &amp;#039;Old exit&amp;#039;):wikitext(args.old_ref)&lt;br /&gt;
		row:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;scope&amp;#039;, &amp;#039;col&amp;#039;):wikitext(args.exit_def or &amp;#039;New exit&amp;#039;):wikitext(args.exit_ref)&lt;br /&gt;
	elseif exit == &amp;#039;exit&amp;#039; then&lt;br /&gt;
		row:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;scope&amp;#039;, &amp;#039;col&amp;#039;):wikitext(args.exit_def or &amp;#039;Exit&amp;#039;):wikitext(args.exit_ref)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if args[2] == &amp;#039;name&amp;#039; then&lt;br /&gt;
		row:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;scope&amp;#039;, &amp;#039;col&amp;#039;):wikitext(args.name_def or &amp;#039;Name&amp;#039;):wikitext(args.name_ref)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	row:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;scope&amp;#039;, &amp;#039;col&amp;#039;):wikitext(args.dest_def or &amp;#039;Destinations&amp;#039;):wikitext(args.dest_ref)&lt;br /&gt;
	&lt;br /&gt;
	row:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;scope&amp;#039;, &amp;#039;col&amp;#039;):wikitext(args.notes_def or &amp;#039;Notes&amp;#039;):wikitext(args.notes_ref)&lt;br /&gt;
	&lt;br /&gt;
	return &amp;#039;\n{| class=&amp;quot;plainrowheaders wikitable&amp;quot;\n&amp;#039; .. tostring(row)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._jcttop(args)&lt;br /&gt;
	-- This function calls two other functions to generate a hatnote and header row.&lt;br /&gt;
	-- This function is accessible from other Lua modules.&lt;br /&gt;
	return hatnote(args) .. header(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.jcttop(frame)&lt;br /&gt;
	-- Entry function for {{jcttop/core}}&lt;br /&gt;
	return p._jcttop(require(&amp;#039;Module:Arguments&amp;#039;).getArgs(frame)) -- Simply call another function with those arguments to actually create the header.&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Tachyony</name></author>
	</entry>
</feed>