<?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%3AJctint%2Fcore</id>
	<title>Module:Jctint/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%3AJctint%2Fcore"/>
	<link rel="alternate" type="text/html" href="https://wiki.tachyony.co.uk/w/index.php?title=Module:Jctint/core&amp;action=history"/>
	<updated>2026-05-15T15:02:51Z</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:Jctint/core&amp;diff=5794&amp;oldid=prev</id>
		<title>Tachyony: Created page with &quot;local p = {} -- Package to be exported  -- Local version of string formatting function local format = mw.ustring.format -- Local version of string trimming function local trim = mw.text.trim -- Store this function in a local variable to avoid expensive table lookups. local insert = table.insert  -- mw.html object for the generated row local row -- Default row span for all columns (`jspan` = &quot;junction span&quot;) local jspan -- Any error messages produced that will be added to...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.tachyony.co.uk/w/index.php?title=Module:Jctint/core&amp;diff=5794&amp;oldid=prev"/>
		<updated>2022-01-15T01:51:57Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local p = {} -- Package to be exported  -- Local version of string formatting function local format = mw.ustring.format -- Local version of string trimming function local trim = mw.text.trim -- Store this function in a local variable to avoid expensive table lookups. local insert = table.insert  -- mw.html object for the generated row local row -- Default row span for all columns (`jspan` = &amp;quot;junction span&amp;quot;) local jspan -- Any error messages produced that will be added to...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {} -- Package to be exported&lt;br /&gt;
&lt;br /&gt;
-- Local version of string formatting function&lt;br /&gt;
local format = mw.ustring.format&lt;br /&gt;
-- Local version of string trimming function&lt;br /&gt;
local trim = mw.text.trim&lt;br /&gt;
-- Store this function in a local variable to avoid expensive table lookups.&lt;br /&gt;
local insert = table.insert&lt;br /&gt;
&lt;br /&gt;
-- mw.html object for the generated row&lt;br /&gt;
local row&lt;br /&gt;
-- Default row span for all columns (`jspan` = &amp;quot;junction span&amp;quot;)&lt;br /&gt;
local jspan&lt;br /&gt;
-- Any error messages produced that will be added to the output&lt;br /&gt;
local errorMsg = {}&lt;br /&gt;
&lt;br /&gt;
-- A specification for self-closing HTML tag.&lt;br /&gt;
local selfClosing = {selfClosing = true}&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
-- Converts the distance specified in unit from `unit` specified in `unitdef`&lt;br /&gt;
-- to the other supported unit.&lt;br /&gt;
local function convert(unit, unitdef)&lt;br /&gt;
	if unit == nil or unitdef == nil then return {} end&lt;br /&gt;
&lt;br /&gt;
	-- Import module to convert length.&lt;br /&gt;
	local util = require(&amp;quot;Module:Road data/util&amp;quot;)&lt;br /&gt;
	local lengths = util.convertLengths({[unitdef] = unit})&lt;br /&gt;
	if lengths.error then -- An error occurred during conversion.&lt;br /&gt;
		-- Add the transcluding page to an error tracking category.&lt;br /&gt;
		local page = mw.title.getCurrentTitle() -- Get transcluding page&amp;#039;s title&lt;br /&gt;
		local pagename = page.prefixedText -- Extract page&amp;#039;s full title as string&lt;br /&gt;
		-- Create category string&lt;br /&gt;
		local category = format(&amp;quot;[[Category:Jctint template using non-numeric parameter values|# %s]]&amp;quot;, pagename)&lt;br /&gt;
		insert(errorMsg, category) -- Add error category to error message table.&lt;br /&gt;
	end&lt;br /&gt;
	return lengths&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- Creates cells for the location columns.&lt;br /&gt;
local function locations(args)&lt;br /&gt;
	-- Unitary, e.g., state line&lt;br /&gt;
	local unitary = args.unitary -- Value to span all of the location columns&lt;br /&gt;
	if unitary then&lt;br /&gt;
		-- Text alignment of the cell contents, default to &amp;quot;left&amp;quot;.&lt;br /&gt;
		local align = args.unitary_align or &amp;#039;left&amp;#039;&lt;br /&gt;
		row:tag(&amp;#039;td&amp;#039;) -- Create unitary cell&lt;br /&gt;
			:attr(&amp;#039;colspan&amp;#039;, 3) -- spanning three possible columns&lt;br /&gt;
			:css(&amp;#039;text-align&amp;#039;, align)&lt;br /&gt;
			:wikitext(unitary) -- Store the contents of unitary in the cell.&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Create cells for regular location columns.&lt;br /&gt;
&lt;br /&gt;
	-- Region, for disambiguation and potentially for display&lt;br /&gt;
	local region = args.region&lt;br /&gt;
	if region or args.region_special then&lt;br /&gt;
		-- Row span for region; must be specified to display a region cell.&lt;br /&gt;
		local regionSpan = args.regionspan&lt;br /&gt;
		if regionSpan then&lt;br /&gt;
			row:tag(&amp;#039;td&amp;#039;) -- Create a region cell&lt;br /&gt;
				:attr(&amp;#039;rowspan&amp;#039;, regionSpan)&lt;br /&gt;
				-- Store region text in the cell.&lt;br /&gt;
				-- `region_special` argument overrides wikilinked `region` argument.&lt;br /&gt;
				:wikitext(args.region_special or format(&amp;quot;[[%s]]&amp;quot;, region))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Primary topic requires no specialization to supplied locations.&lt;br /&gt;
	local primaryTopic = args.primary_topic ~= &amp;#039;no&amp;#039;&lt;br /&gt;
&lt;br /&gt;
	-- Note below main text in the next column&lt;br /&gt;
	local sub1note = args.sub1_note -- check existence later&lt;br /&gt;
	-- Row span for the last location column, default to `jspan`&lt;br /&gt;
	local sub2span = args.sub2span or jspan&lt;br /&gt;
&lt;br /&gt;
	-- Independent city&lt;br /&gt;
	local indepCityText -- Value to span both subdivision columns.&lt;br /&gt;
	if args.indep_city_special then&lt;br /&gt;
		indepCityText = args.indep_city_special -- Overrides `indep_city` argument.&lt;br /&gt;
	elseif args.indep_city then&lt;br /&gt;
		local indepCity = args.indep_city&lt;br /&gt;
		local cityLink -- Wikilink for independent city&lt;br /&gt;
		if primaryTopic then&lt;br /&gt;
			cityLink = format(&amp;#039;[[%s]]&amp;#039;, indepCity)&lt;br /&gt;
		elseif region then&lt;br /&gt;
			-- Specialize independent city to the region.&lt;br /&gt;
			cityLink = format(&amp;#039;[[%s, %s|%s]]&amp;#039;, indepCity, region, indepCity)&lt;br /&gt;
		end&lt;br /&gt;
		if cityLink then&lt;br /&gt;
			indepCityText = &amp;quot;[[Independent city|City]] of &amp;quot; .. cityLink&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if indepCityText then -- Display independent city.&lt;br /&gt;
		-- Text alignment of the cell contents, default to &amp;quot;left&amp;quot;.&lt;br /&gt;
		local align = args.indep_city_align or &amp;#039;left&amp;#039;&lt;br /&gt;
		local indepCityCell = row:tag(&amp;#039;td&amp;#039;) -- Create independent city cell&lt;br /&gt;
			:attr(&amp;#039;colspan&amp;#039;, 2) -- spanning two columns&lt;br /&gt;
			:attr(&amp;#039;rowspan&amp;#039;, sub2span) -- with the calculated row span.&lt;br /&gt;
			:css(&amp;#039;text-align&amp;#039;, align)&lt;br /&gt;
			:wikitext(indepCityText) -- Store the independent city in the cell.&lt;br /&gt;
		if sub1note then -- A note is provided.&lt;br /&gt;
			indepCityCell:tag(&amp;#039;br&amp;#039;, selfClosing) -- Add a line break to the cell.&lt;br /&gt;
			-- Add the note to the cell, within an HTML &amp;lt;small&amp;gt; tag.&lt;br /&gt;
			indepCityCell:tag(&amp;#039;small&amp;#039;):wikitext(sub1note)&lt;br /&gt;
		end&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Create two cells for the first- and second-level subdivisions.&lt;br /&gt;
&lt;br /&gt;
	-- First-level subdivision, e.g., county&lt;br /&gt;
	-- Name of the type of subdivision, e.g., &amp;quot;County&amp;quot; and &amp;quot;Parish&amp;quot;&lt;br /&gt;
	local sub1name = args.sub1name -- check existence later&lt;br /&gt;
	local sub1Text -- Value for first-level subdivision column.&lt;br /&gt;
	if args.sub1_special then&lt;br /&gt;
		sub1Text = args.sub1_special -- Overrides `sub1` argument.&lt;br /&gt;
	elseif args.sub1 then&lt;br /&gt;
		local sub1 = args.sub1&lt;br /&gt;
		if primaryTopic then&lt;br /&gt;
			-- Add type (if specified) to wikilink for first-level subdivision.&lt;br /&gt;
			local sub1Link = sub1name and format(&amp;quot;%s %s&amp;quot;, sub1, sub1name) or sub1&lt;br /&gt;
			sub1Text = format(&amp;#039;[[%s|%s]]&amp;#039;, sub1Link, sub1)&lt;br /&gt;
		elseif region and sub1name then&lt;br /&gt;
			-- Add type to first-level subdivision.&lt;br /&gt;
			local sub1Typed = trim(format(&amp;#039;%s %s&amp;#039;, sub1, sub1name))&lt;br /&gt;
			-- Specialize first-level subdivision, with type added, to the region.&lt;br /&gt;
			sub1Text = format(&amp;#039;[[%s, %s|%s]]&amp;#039;, sub1Typed, region, sub1)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if sub1Text then -- Display first-level subdivision.&lt;br /&gt;
		-- Row span for first-level subdivision, default to `jspan`.&lt;br /&gt;
		local sub1span = args.sub1span or jspan&lt;br /&gt;
		local sub1Cell = row:tag(&amp;#039;td&amp;#039;) -- Create first-level subdivision cell&lt;br /&gt;
			:attr(&amp;#039;rowspan&amp;#039;, sub1span) -- with the calculated row span.&lt;br /&gt;
			:wikitext(sub1Text) -- Store the first-level subdivision in the cell.&lt;br /&gt;
		if sub1note then -- A note is provided.&lt;br /&gt;
			sub1Cell:tag(&amp;#039;br&amp;#039;, selfClosing) -- Add a line break to the cell.&lt;br /&gt;
			-- Add the note to the cell, within an HTML &amp;lt;small&amp;gt; tag.&lt;br /&gt;
			sub1Cell:tag(&amp;#039;small&amp;#039;):wikitext(sub1note)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Second-level subdivision, e.g., city and town&lt;br /&gt;
	local sub2Text -- Value for second-level subdivision column.&lt;br /&gt;
	if args.sub2_special then&lt;br /&gt;
		sub2Text = args.sub2_special -- Overrides `sub2` argument.&lt;br /&gt;
	elseif args.sub2 then&lt;br /&gt;
		local sub2 = args.sub2&lt;br /&gt;
		if sub2 == &amp;quot;none&amp;quot; or sub2 == &amp;quot;&amp;amp;nbsp;&amp;quot; then&lt;br /&gt;
			sub2Text = &amp;quot;&amp;amp;#8203;&amp;quot; -- Zero-width space&lt;br /&gt;
		elseif primaryTopic then&lt;br /&gt;
			sub2Text = format(&amp;quot;[[%s]]&amp;quot;, sub2)&lt;br /&gt;
		else&lt;br /&gt;
			local sub2Link = {sub2}&lt;br /&gt;
			local sub2Name = sub2&lt;br /&gt;
			-- Type of area, e.g., city and village, as a form of disambiguation&lt;br /&gt;
			local area = args.area&lt;br /&gt;
			if area then&lt;br /&gt;
				insert(sub2Link, format(&amp;#039; (%s)&amp;#039;, area)) -- Add area to wikilink.&lt;br /&gt;
				local areas = { -- table of different area types&lt;br /&gt;
					borough = &amp;quot;Borough&amp;quot;,&lt;br /&gt;
					city = &amp;quot;City&amp;quot;,&lt;br /&gt;
					community = &amp;quot;Community&amp;quot;,&lt;br /&gt;
					CDP = &amp;quot;Community&amp;quot;,&lt;br /&gt;
					hamlet = &amp;quot;Hamlet&amp;quot;,&lt;br /&gt;
					town = &amp;quot;Town&amp;quot;,&lt;br /&gt;
					village = &amp;quot;Village&amp;quot;,&lt;br /&gt;
					[&amp;quot;unorganized territory&amp;quot;] = &amp;quot;Unorganized Territory&amp;quot;&lt;br /&gt;
				}&lt;br /&gt;
				-- Add area name to displayed wikitext.&lt;br /&gt;
				sub2Name = format(&amp;quot;%s of %s&amp;quot;, areas[area], sub2Name)&lt;br /&gt;
			end&lt;br /&gt;
			insert(sub2Link, &amp;quot;, &amp;quot;)&lt;br /&gt;
			-- Some second-level subdivisions are not unique in a given region.&lt;br /&gt;
			-- `sub1dab` is the first-level subdivision to be used for disambiguation.&lt;br /&gt;
			local sub1dab = args.sub1dab &lt;br /&gt;
			if sub1dab and sub1name then&lt;br /&gt;
				insert(sub2Link, trim(format(&amp;#039;%s %s&amp;#039;, sub1dab, sub1name)) .. &amp;quot;, &amp;quot;)&lt;br /&gt;
			end&lt;br /&gt;
			if region then&lt;br /&gt;
				insert(sub2Link, region) -- Add region to wikilink&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			sub2Text = format(&amp;quot;[[%s|%s]]&amp;quot;, table.concat(sub2Link), sub2Name)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if sub2Text then -- Display second-level subdivision.&lt;br /&gt;
		row:tag(&amp;#039;td&amp;#039;) -- Create second-level subdivision cell&lt;br /&gt;
			:attr(&amp;#039;rowspan&amp;#039;, sub2span) -- with the calculated row span.&lt;br /&gt;
			:wikitext(sub2Text) -- Store the second-level subdivision in the cell.&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- Creates cells for the distance columns.&lt;br /&gt;
local function units(args)&lt;br /&gt;
	-- Alternate units, e.g., California&amp;#039;s postmiles.&lt;br /&gt;
	local alt_unit = args.altunit&lt;br /&gt;
	if alt_unit then -- Alternate units override standard units.&lt;br /&gt;
		-- Row span (`auspan` = &amp;quot;alt[ernate] unit span&amp;quot;)&lt;br /&gt;
		local auspan = args.auspan or jspan&lt;br /&gt;
		-- Create the alternate unit cell as a header cell for the row,&lt;br /&gt;
		-- since it is usually unique within the table.&lt;br /&gt;
		row:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;scope&amp;#039;, &amp;#039;row&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;text-align&amp;#039;, &amp;#039;right&amp;#039;)&lt;br /&gt;
			:attr(&amp;#039;rowspan&amp;#039;, auspan)&lt;br /&gt;
			:wikitext(alt_unit) -- Store the contents of alt_unit in the cell.&lt;br /&gt;
	else&lt;br /&gt;
		-- Convert numeric distances to a secondary unit, and display both units.&lt;br /&gt;
		-- Distance in the primary unit, or &amp;#039;none&amp;#039;&lt;br /&gt;
		local unit = args.unit&lt;br /&gt;
		-- If `unit` is &amp;quot;none&amp;quot;, no cells are displayed.&lt;br /&gt;
		if unit == &amp;quot;none&amp;quot; then return end&lt;br /&gt;
		local unitdef = args.unitdef or &amp;quot;km&amp;quot; -- The primary unit (&amp;#039;mi&amp;#039; or &amp;#039;km&amp;#039;)&lt;br /&gt;
		-- Convert and format the distance.&lt;br /&gt;
		local lengths = convert(unit, unitdef)&lt;br /&gt;
		-- Row span (`uspan` = &amp;quot;unit span&amp;quot;)&lt;br /&gt;
		local uspan = args.uspan or jspan&lt;br /&gt;
		-- Create the primary unit cell as a header cell for the row,&lt;br /&gt;
		-- since it is usually unique within the table.&lt;br /&gt;
		local primary = row:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;scope&amp;#039;, &amp;#039;row&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;text-align&amp;#039;, &amp;#039;right&amp;#039;)&lt;br /&gt;
			:attr(&amp;#039;rowspan&amp;#039;, uspan)&lt;br /&gt;
			-- Store the primary distance and any conversion error message in the cell.&lt;br /&gt;
			:wikitext(lengths[lengths.orig], lengths.error)&lt;br /&gt;
		local secondary = row:tag(&amp;#039;td&amp;#039;) -- Create the secondary unit cell.&lt;br /&gt;
			:css(&amp;#039;text-align&amp;#039;, &amp;#039;right&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;background-color&amp;#039;, &amp;#039;#eaecf0&amp;#039;)&lt;br /&gt;
			:attr(&amp;#039;rowspan&amp;#039;, uspan)&lt;br /&gt;
			:wikitext(lengths[lengths.comp]) -- Store the secondary distance in the cell.&lt;br /&gt;
&lt;br /&gt;
		local unit_ref = args.unit_ref&lt;br /&gt;
		if unit_ref then -- A reference is provided for the distance.&lt;br /&gt;
			primary:wikitext(unit_ref) -- Add reference to the primary distance cell.&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		local unit2 = args.unit2&lt;br /&gt;
		if unit2 then -- A second distance is provided.&lt;br /&gt;
			local line = args.line -- A horizontal rule may be requested between the distances.&lt;br /&gt;
			if line then&lt;br /&gt;
				-- Add a horizontal rule to both cells.&lt;br /&gt;
				primary:tag(&amp;#039;hr&amp;#039;, selfClosing)&lt;br /&gt;
				secondary:tag(&amp;#039;hr&amp;#039;, selfClosing)&lt;br /&gt;
			else&lt;br /&gt;
				-- Add an en-dash and a line break to both cells.&lt;br /&gt;
				primary:wikitext(&amp;#039;–&amp;#039;):tag(&amp;#039;br&amp;#039;, selfClosing)&lt;br /&gt;
				secondary:wikitext(&amp;#039;–&amp;#039;):tag(&amp;#039;br&amp;#039;, selfClosing)&lt;br /&gt;
			end&lt;br /&gt;
			-- Convert and format the second distance.&lt;br /&gt;
			local lengths2 = convert(unit2, unitdef)&lt;br /&gt;
			-- Add the second distance and any conversion error message to the primary distance cell.&lt;br /&gt;
			primary:wikitext(lengths2[lengths2.orig], lengths2.error)&lt;br /&gt;
			-- Add the converted second distance to the secondary distance cell.&lt;br /&gt;
			secondary:wikitext(lengths2[lengths2.comp])&lt;br /&gt;
			end&lt;br /&gt;
		&lt;br /&gt;
		local unit2_ref = args.unit2_ref&lt;br /&gt;
		if unit2_ref then -- A reference is provided for the distance.&lt;br /&gt;
			primary:wikitext(unit2_ref) -- Add reference to the primary distance cell.&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Color specified by any supplied type&lt;br /&gt;
local color&lt;br /&gt;
-- Tooltip specified by any supplied type&lt;br /&gt;
local title&lt;br /&gt;
&lt;br /&gt;
--- Apply any type-derived coloring and tooltip to the given cell.&lt;br /&gt;
local function applyTypeStyle(cell)&lt;br /&gt;
	cell:attr(&amp;#039;title&amp;#039;, title):css(&amp;#039;background-color&amp;#039;, color)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- Creates a cell for places, such as bridges and rest areas.&lt;br /&gt;
local function place(args)&lt;br /&gt;
	local place = args.place -- Contents of the place cell&lt;br /&gt;
	-- Do nothing if `place` is &amp;quot;none&amp;quot;&lt;br /&gt;
	if place == &amp;quot;none&amp;quot; then return end&lt;br /&gt;
	local colspan = 2 -- Initial column span&lt;br /&gt;
	local exit = args[1] -- Whether this table has exit number columns&lt;br /&gt;
	local named = args[2] -- Whether this table has named junction column&lt;br /&gt;
	-- Adjust column span&lt;br /&gt;
	if exit == &amp;quot;old&amp;quot; then colspan = colspan + 2&lt;br /&gt;
	elseif exit == &amp;quot;exit&amp;quot; then colspan = colspan + 1&lt;br /&gt;
	end&lt;br /&gt;
	if named == &amp;quot;name&amp;quot; then colspan = colspan + 1 end&lt;br /&gt;
	-- Row span (`pspan` = &amp;quot;place span&amp;quot;)&lt;br /&gt;
	local pspan = args.pspan or jspan&lt;br /&gt;
	local placeCell = row:tag(&amp;#039;td&amp;#039;) -- Create place cell&lt;br /&gt;
		:css(&amp;#039;text-align&amp;#039;, &amp;#039;center&amp;#039;)&lt;br /&gt;
		:attr(&amp;#039;colspan&amp;#039;, colspan)&lt;br /&gt;
		:attr(&amp;#039;rowspan&amp;#039;, pspan)&lt;br /&gt;
		:wikitext(place) -- Store the place in the cell&lt;br /&gt;
	applyTypeStyle(placeCell)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- Creates cells for exit number and named junction columns.&lt;br /&gt;
local function exits(args)&lt;br /&gt;
	local exit = args[1] -- &amp;#039;exit&amp;#039;, &amp;#039;old&amp;#039;, or nil&lt;br /&gt;
	local named = args[2] -- &amp;#039;name&amp;#039; or nil&lt;br /&gt;
&lt;br /&gt;
	if exit == &amp;#039;old&amp;#039; then -- Add old exit number cell&lt;br /&gt;
		-- Row span (`ospan` = &amp;quot;old span&amp;quot;)&lt;br /&gt;
		local ospan = args.ospan or jspan&lt;br /&gt;
		row:tag(&amp;#039;td&amp;#039;) -- Create old exit number cell&lt;br /&gt;
			:css(&amp;#039;text-align&amp;#039;, &amp;#039;center&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;background-color&amp;#039;, &amp;#039;#d3d3d3&amp;#039;)&lt;br /&gt;
			:attr(&amp;#039;title&amp;#039;, &amp;#039;Former exit number&amp;#039;)&lt;br /&gt;
			:attr(&amp;#039;rowspan&amp;#039;, ospan)&lt;br /&gt;
			:wikitext(args.old) -- Store the old exit number in the cell&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if exit then -- &amp;quot;exit&amp;quot; or &amp;quot;old&amp;quot; is defined; add current exit number cell&lt;br /&gt;
		-- Row span (`espan` = &amp;quot;exit span&amp;quot;)&lt;br /&gt;
		local espan = args.espan or jspan&lt;br /&gt;
		local exitCell = row:tag(&amp;#039;td&amp;#039;) -- Create exit number cell&lt;br /&gt;
			:css(&amp;#039;text-align&amp;#039;, &amp;#039;center&amp;#039;)&lt;br /&gt;
			:attr(&amp;#039;rowspan&amp;#039;, espan)&lt;br /&gt;
			:wikitext(args.exit) -- Store the exit number in the cell&lt;br /&gt;
		applyTypeStyle(exitCell)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if named then -- Junction list has a junction name column&lt;br /&gt;
		local namespan = args.namespan or jspan -- Row span&lt;br /&gt;
		local nameCell = row:tag(&amp;#039;td&amp;#039;) -- Create junction name cell&lt;br /&gt;
			:attr(&amp;#039;rowspan&amp;#039;, namespan)&lt;br /&gt;
			:wikitext(args.name) -- Store the junction name in the cell&lt;br /&gt;
		applyTypeStyle(nameCell)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- Creates cell for the destinations column.&lt;br /&gt;
local function destinations(args)&lt;br /&gt;
	local road = args.road -- Contents of the destinations cell&lt;br /&gt;
	-- Do nothing if `road` is &amp;quot;none&amp;quot;&lt;br /&gt;
	if road == &amp;quot;none&amp;quot; then return end&lt;br /&gt;
	-- Column span (`rcspan` = &amp;quot;road column span&amp;quot;), default to 1&lt;br /&gt;
	local rcspan = args.rcspan or 1&lt;br /&gt;
	-- Row span (`rspan` = &amp;quot;road span&amp;quot;)&lt;br /&gt;
	local rspan = args.rspan or jspan&lt;br /&gt;
	local destCell = row:tag(&amp;#039;td&amp;#039;) -- Create destination cell&lt;br /&gt;
		:attr(&amp;#039;colspan&amp;#039;, rcspan)&lt;br /&gt;
		:attr(&amp;#039;rowspan&amp;#039;, rspan)&lt;br /&gt;
		:wikitext(road) -- Store the destination in the cell&lt;br /&gt;
	applyTypeStyle(destCell)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- Creates cell for the notes column.&lt;br /&gt;
local function notes(args)&lt;br /&gt;
	local notes = args.notes -- Contents of the notes cell&lt;br /&gt;
	-- Do nothing if `notes` is &amp;quot;none&amp;quot;&lt;br /&gt;
	if notes == &amp;quot;none&amp;quot; then return end&lt;br /&gt;
	-- Row span (`nspan` = &amp;quot;notes span&amp;quot;)&lt;br /&gt;
	local nspan = args.nspan or jspan&lt;br /&gt;
	local notesCell = row:tag(&amp;#039;td&amp;#039;) -- Create notes cell&lt;br /&gt;
		:attr(&amp;#039;rowspan&amp;#039;, nspan)&lt;br /&gt;
		:wikitext(notes) -- Store the notes in the cell&lt;br /&gt;
	applyTypeStyle(notesCell)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
-- Returns a row in the junction list.&lt;br /&gt;
-- Accessible from other Lua modules&lt;br /&gt;
function p._jctint(args)&lt;br /&gt;
	jspan = args.jspan or 1 -- Global row span for all columns; defaults to 1&lt;br /&gt;
	-- {{{type}}} argument to determine color and tooltips&lt;br /&gt;
	local argType = args.type&lt;br /&gt;
	if argType then -- {{{type}}} was passed&lt;br /&gt;
		-- Type-based data for colors and tooltips&lt;br /&gt;
		if argType == &amp;#039;mplex&amp;#039; then&lt;br /&gt;
			local page = mw.title.getCurrentTitle() -- Get transcluding page&amp;#039;s title&lt;br /&gt;
			local pagename = page.prefixedText -- Extract page&amp;#039;s full title as string&lt;br /&gt;
			insert(errorMsg,&lt;br /&gt;
				format(&amp;quot;[[Category:Jctint template with invalid type|$ %s]]&amp;quot;, pagename))&lt;br /&gt;
		end&lt;br /&gt;
		local types = mw.loadData(&amp;quot;Module:Road data/RJL types&amp;quot;)&lt;br /&gt;
		local typeData = types[string.lower(argType)] -- Retrieve the type data&lt;br /&gt;
		if typeData then&lt;br /&gt;
			color = typeData.color -- Store the color globally&lt;br /&gt;
			title = typeData.jctint -- Store the tooltip globally&lt;br /&gt;
		else&lt;br /&gt;
			-- Add error category to error message table.&lt;br /&gt;
			local page = mw.title.getCurrentTitle() -- Get transcluding page&amp;#039;s title&lt;br /&gt;
			local pagename = page.prefixedText -- Extract page&amp;#039;s full title as string&lt;br /&gt;
			insert(errorMsg,&lt;br /&gt;
				format(&amp;quot;[[Category:Jctint template with invalid type|%s]]&amp;quot;, pagename))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local root = mw.html.create() -- Create the root mw.html object to return&lt;br /&gt;
	-- Create the table row and store it globally&lt;br /&gt;
	row = root:tag(&amp;#039;tr&amp;#039;):css(&amp;#039;text-align&amp;#039;, &amp;#039;left&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
	locations(args) -- Handle location arguments&lt;br /&gt;
	units(args) -- Handle distance arguments&lt;br /&gt;
	if args.place then -- {{{place}}} spans all columns to the right of the distances&lt;br /&gt;
		place(args) -- Create cell for place&lt;br /&gt;
	else&lt;br /&gt;
		exits(args) -- Handle exit/named junction arguments&lt;br /&gt;
		destinations(args) -- Handle destinations&lt;br /&gt;
		notes(args) -- Handle notes&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Return the HTML code in the mw.html object as a string, plus any error messages&lt;br /&gt;
	return tostring(root) .. table.concat(errorMsg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- Entry function for {{jctint/core}}&lt;br /&gt;
function p.jctint(frame)&lt;br /&gt;
	-- Import module function to work with passed arguments&lt;br /&gt;
	local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
	-- Gather passed arguments into easy-to-use table&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	return p._jctint(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p -- Return package&lt;/div&gt;</summary>
		<author><name>Tachyony</name></author>
	</entry>
</feed>