Jump to content

Module:Adjacent stations/Taipei Metro

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Szqecs (talk | contribs) at 13:59, 22 April 2018 (Created page with 'local function link(s1, s2, s3) if s3 then return table.concat({'\[\[', s1, '|', s3, '\]\]'}) elseif s2 then return table.concat({'\[\[', s1, s2, '|', s1,...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

local function link(s1, s2, s3)
	if s3 then
		return table.concat({'\[\[', s1, '|', s3, '\]\]'})
	elseif s2 then
		return table.concat({'\[\[', s1, s2, '|', s1, '\]\]'})
	elseif s1 then
		return table.concat({'\[\[', s1, '\]\]'})
	end
end

return {
	['system title'] = '\[\[File:Taipei Metro Logo(Logo Only).svg|18px\]\] ' .. link('Taipei Metro')
	, ['BR'] = {
		['line title'] = '\[\[File:Taipei Metro Line BR.svg|18px\]\] ' .. link('Wenhu line')
		, ['colour'] = '9e652e'
		, ['station link'] = function(s)
			if s == 'Taipei Zoo' then
				return link('Taipei Zoo', ' station')
			else
				return link(s, ' MRT station')
			end
		end
		, ['left terminus'] = 'Taipei Nangang Exhibition Center'
		, ['right terminus'] = 'Taipei Zoo'
	}
	, ['R'] = {
		['line title'] = '\[\[File:Taipei Metro Line R.svg|18px\]\] ' .. link('Tamsui–Xinyi line')
		, ['colour'] = 'cb2c30'
		, ['station link'] = function(s)
			local exception = {
				['Taipei Main'] = link('Taipei station', nil, 'Taipei Main station')
				, ['Tamsui or Beitou'] = link('Tamsui', ' MRT station') .. ' or ' .. link('Beitou', ' MRT station')
				, ['Xiangshan or Daan'] = link('Xiangshan', ' MRT station') .. ' or ' .. link('Daan', ' MRT station')
			}
			return link(s, ' MRT station')
		end
		, ['left terminus'] = {
			'Tamsui or Beitou'
			, ['Tamsui'] = 'Tamsui'
		}
		, ['right terminus'] = {
			'Xiangshan or Daan'
			, ['Xiangshan'] = 'Xiangshan'
		}
	}
}