வார்ப்புரு:Adjacent stations/doc
{{Documentation subpage}}
 &lt;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --&gt;
 {{High-use}}
 {{Sidebar Adjacent stations}}
 {{tsh|adjstn}}
 {{Uses TemplateStyles|Template:Adjacent stations/styles.css}}
 
 ''Adjacent stations'' is a specialised [[Wikipedia:WikiProject_Succession_Box_Standardization#Overview|succession box]] template that links adjacent station articles, along with the termini of one or more lines or services. It is a Lua version of {{tl|S-line}} (see [[#Differences from S-line|differences]]).
 
 == Usage ==
 === Data module ===
 Before the template can be used, a module needs to be created that includes information about the transport system such as the title, lines and the termini of those lines. The data module needs to be a sub-page of ''Module:Adjacent stations'' (Module:Adjacent stations/''system''), and needs to be of a specific structure.
 
 See [[Module:Adjacent stations]] for a guide on creating and editing data modules. Note that not all variables are used by this template.
 
 If a system exists in {{tl|S-line}}, you can also use {{tlx|Adjacent stations/row|&lt;var&gt;system&lt;/var&gt;|&lt;var&gt;line&lt;/var&gt;}} inside [[Special:ExpandTemplates]] to simplify subpage creation for lines with two termini&lt;!-- add explanation for lines with multiple termini stating that the table currently has to be inserted manually --&gt;. You will need to replace every two spaces with a tab space afterwards.
 
 === Transclusion ===
 For multiple lines or systems, this template only needs to be transcluded once. Each line is assigned a number. The parameters for the corresponding line are suffixed by the number (e.g. &lt;code&gt;system2&lt;/code&gt;, &lt;code&gt;line2&lt;/code&gt;). Parameters without a number suffix are treated as group 1.
 
 === Parameters ===
 {| class=&quot;wikitable&quot;
 |+
 !Parameter
 !Description
 !Behaviour if absent
 !Notes
 |-
 |system&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |The system to which line &lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt; belongs. This should correspond to a subpage of [[Module:Adjacent stations]].
 |
 * System for &lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt; assumed to be same as the previous group.
 * Renders empty table if no systems are entered.
 |Displays error message if unrecognised. 
 |-
 |line&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |The name of line &lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt; (or recognised alias). This should correspond to a key under &lt;code&gt;[&quot;lines&quot;]&lt;/code&gt; in data. Displays the termini of the line as subtext in left and right cells by default. Renders ''Terminus'' as subtext if adjacent station is terminus.
 |
 * Line for &lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt; assumed to be same as the previous group.
 * Renders only header row if no lines are entered.
 |Displays error message if unrecognised.
 |-
 |left&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |The name of the previous station. Renders the formatted station name in the left cell as main text.
 |Renders ''Terminus'' in the left cell as main text.
 |
 |-
 |right&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |The name of the next station. Renders the formatted station name in the right cell as main text.
 |Renders ''Terminus'' in the right cell as main text.
 |
 |-
 |to-left&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |The left terminus name or alias. Used to replace left terminus where it is non-default.
 |Uses default left terminus.
 |Uses un-formatted name if terminus is absent in data.
 |-
 |to-right&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |The right terminus name or alias. Used to replace right terminus where it is non-default.
 |Uses default right terminus.
 |Uses un-formatted name if terminus is absent in data.
 |-
 |to&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |Terminus name or alias on either side. Used to replace either terminus where it is non-default.
 |Uses default termini.
 |Only replaces side with defined terminus in data.
 |-
 |transfer&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |The name of the transfer station for the line, at stations where an interchange with a line at another nearby station is possible.
 |
 |
 |-
 |oneway-left&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |If entered, 'One-way operation' is displayed in the left cell instead of the small text which indicates the line terminus. This can also be entered for the whole line in the system subpage.
 |
 |
 |-
 |oneway-right&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |If entered, 'One-way operation' is displayed in the right cell instead of the small text which indicates the line terminus. This can also be entered for the whole line in the system subpage.
 |
 |
 |-
 |nonstop&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |If entered, instead of displaying previous and next stations, displays '&lt;var&gt;line&lt;/var&gt; does not stop here'. If the value for this parameter is 'former', then 'did not stop here' will be used instead.
 |
 |
 |-
 |header&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |A table header across the width of the table, displayed above the succession for the line. This will display with or without other parameters with the same number.
 |
 |
 |-
 |hide-system&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |When set to any value, the system row is not displayed. This is useful in the middle of a table when a different module is used but the displayed system name would be the same. 
 |System name is displayed.
 |See [[Coevorden railway station]] for an example.
 |-
 |note-row&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |A note across the width of the table, displayed below the succession for the line. This will display with or without other parameters with the same number.
 |
 |
 |-
 |note-left&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |A note, displayed below the left (previous) station's name.
 |
 |
 |-
 |note-mid&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |A note, displayed below the line name.
 |
 |
 |-
 |note-right&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |A note, displayed below the right (next) station's name.
 |
 |
 |-
 |through&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |The through line – trains on the line run through to this line. If this is entered, 'through to &lt;var&gt;line'&lt;/var&gt;, in italics, displays where 'Terminus' would.
 |
 |
 |-
 |through-left&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |The through line for the left cell only (primarily for compatibility purposes).
 |
 |
 |-
 |through-right&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |The through line for the right cell only (primarily for compatibility purposes).
 |
 |
 |-
 |reverse&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |If this is entered, 'reverses direction', in italics, displays where 'Terminus' would.
 |
 |
 |-
 |reverse-left&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |The same for the left cell only (primarily for compatibility purposes).
 |
 |
 |-
 |reverse-right&lt;small&gt;&lt;var&gt;n&lt;/var&gt;&lt;/small&gt;
 |The same for the right cell only (primarily for compatibility purposes).
 |
 |
 |-
 |noclear
 |Prevents the template from inserting the equivalent of {{tl|clear}} before the template. In the article body, this parameter can be set to &lt;var&gt;y&lt;/var&gt; for an inline version of the template. Do not use this parameter inside {{tl|Infobox station}}'s {{para|services}} parameter.
 |The equivalent of {{tl|clear}} is inserted before the template. This is the default.
 |
 |}
 
 == Conversion from S-line ==
 After creating the module subpage, you can use the &lt;code&gt;convert&lt;/code&gt; function of [[Module:Adjacent stations]] to replace transclusions of the S-line series templates (this currently does ''not'' work with {{tl|Rail line}}-series templates). This can be semi-automated using [[regular expressions]] in [[WP:AWB|AWB]] and other tools:
 
 {| class=&quot;wikitable&quot;
 ! Find !! Replace !! Notes
 |-
 | {{mono|1=\&amp;#124;\s*system\s*=\s*&lt;var&gt;oldSystem&lt;/var&gt;}} || {{mono|1=&amp;#124;system=&lt;var&gt;newSystem&lt;/var&gt;}} || Replacement for system name in {{tl|S-line}}, if the old system is different from the new system. (Not necessary for {{tl|S-rail}}, which is ignored.) Use the ''g'' regular expression flag to replace multiple uses.
 |-
 | {{mono|1=&lt;nowiki&gt;(\| *(?:services|other_services) *=)((?:\s*\{\{.+\}\})+)&lt;/nowiki&gt;}} || {{codett|1=&lt;nowiki&gt;$1 {{subst:#invoke:Adjacent stations|convert|$2}}&lt;/nowiki&gt;}} || Replacement for {{tl|Infobox station}}'s {{para|services}} and {{para|other_services}} parameters.
 |-
 | {{mono|1=&lt;nowiki&gt;(\{\{[Ss](?:(?:-rail)?-s)?tart\}\}(?:\s*\{\{.+\}\})+\s*\{\{(?:[Ss]-end|[Ee]nd)\}\})&lt;/nowiki&gt;}} || {{mono|1=&lt;nowiki&gt;{{subst:#invoke:Adjacent stations|convert|$1}}&lt;/nowiki&gt;}} || Replacement for standalone succession boxes. Use the ''g'' regular expression flag to replace multiple boxes on the page.
 |}
 
 The conversion will not work if
 * the input includes templates other than those in the S-line series;
 * a system or line in the input is unrecognized or otherwise invalid;
 * there are unmatched square or curly brackets in the input.
 
 == Differences from S-line ==
 {{Adjacent stations/doc/differences from S-line}}
 
 == Examples ==
 {{Markup
 |&lt;nowiki&gt;{{Adjacent stations
 |system=JR East
 |line=Tohoku Shinkansen|type=Yamabiko
 |left=Fukushima|right=Sendai
 }}&lt;/nowiki&gt;
 |{{center|[[Module:Adjacent stations/JR East]]&lt;br/&gt;('''[[Shiroishi-Zaō Station]]''')}}{{Adjacent stations
 |system=JR East
 |line=Tohoku Shinkansen|type=Yamabiko|left=Fukushima|right=Sendai
 }}
 
 |&lt;nowiki&gt;{{Adjacent stations
 |system=New York City Subway
 |line=Rockaway
 |left=Rockaway Boulevard|right=Aqueduct–North Conduit Avenue
 |oneway-right=yes
 }}&lt;/nowiki&gt;
 |{{center|[[Module:Adjacent stations/New York City Subway]]&lt;br/&gt;('''[[Aqueduct Racetrack station]]''')}}{{Adjacent stations
 |system=New York City Subway
 |line=Rockaway|left=Rockaway Boulevard|right=Aqueduct–North Conduit Avenue
 |oneway-right=yes
 }}
 
 |&lt;nowiki&gt;{{Adjacent stations
 |system=London Underground
 |line1=Bakerloo|left1=Regent's Park|right1=Piccadilly Circus
 |line2=Central|left2=Bond Street|right2=Tottenham Court Road
 |line3=Victoria|left3=Green Park|right3=Warren Street
 }}&lt;/nowiki&gt;
 |{{center|[[Module:Adjacent stations/London Underground]]&lt;br/&gt;('''[[Oxford Circus tube station]]''')}}{{Adjacent stations
 |system=London Underground
 |line1=Bakerloo|left1=Regent's Park|right1=Piccadilly Circus
 |line2=Central|left2=Bond Street|right2=Tottenham Court Road
 |line3=Victoria|left3=Green Park|right3=Warren Street
 }}
 
 |&lt;nowiki&gt;{{Adjacent stations
 |system=Walt Disney World Monorail
 |line1=Resort|left1=Contemporary|right1=Polynesian Village
 |oneway-left1=yes
 |line2=Express|left2=Magic Kingdom|right2=Magic Kingdom
 |oneway-right2=yes
 |line3=Epcot|right3=Epcot
 }}&lt;/nowiki&gt;
 |{{center|[[Module:Adjacent stations/Walt Disney World Monorail]]&lt;br/&gt;('''[[Transportation and Ticket Center]]''')}}{{Adjacent stations
 |system=Walt Disney World Monorail
 |line1=Resort|left1=Contemporary|right1=Polynesian Village
 |oneway-left1=yes
 |line2=Express|left2=Magic Kingdom|right2=Magic Kingdom
 |oneway-right2=yes
 |line3=Epcot|right3=Epcot
 }}
 
 |&lt;nowiki&gt;{{Adjacent stations
 |system1=Taiwan High Speed Rail
 |left1=Nangang|right1=Banqiao
 |system2=Taiwan Railways
 |line2=West Coast|left2=Songshan|right2=Wanhua
 }}&lt;/nowiki&gt;
 |{{center|[[Module:Adjacent stations/Taiwan High Speed Rail]]&lt;br/&gt;[[Module:Adjacent stations/Taiwan Railways]]&lt;br/&gt;('''[[Taipei Main Station]]''')}}{{Adjacent stations
 |system1=Taiwan High Speed Rail
 |left1=Nangang|right1=Banqiao
 |system2=Taiwan Railways
 |line2=West Coast|left2=Songshan|right2=Wanhua
 }}
 
 |&lt;nowiki&gt;{{Adjacent stations
 |system=RTA Rapid Transit
 |line1=Red
 |left1=West 25th–Ohio City|right1=Tri-C–Campus District
 |line2=Blue
 |through-left2=Waterfront Line|right2=Tri-C–Campus District
 |line3=Green
 |through-left3=Waterfront Line|right3=Tri-C–Campus District
 |line4=Waterfront
 |left4=Settlers Landing|through-right4=Blue and Green Lines
 }}&lt;/nowiki&gt;
 |{{center|[[Module:Adjacent stations/RTA Rapid Transit]]&lt;br/&gt;('''[[Tower City station]]''')}}{{Adjacent stations
 |system=RTA Rapid Transit
 |line1=Red|left1=West 25th–Ohio City|right1=Tri-C–Campus District
 |line2=Blue|through-left2=Waterfront Line|right2=Tri-C–Campus District
 |line3=Green|through-left3=Waterfront Line|right3=Tri-C–Campus District
 |line4=Waterfront|left4=Settlers Landing|through-right4=Blue and Green Lines
 }}
 
 |&lt;nowiki&gt;{{Adjacent stations
 |system=MTR
 |line1=Tung Chung|left1=Tsing Yi|right1=Tung Chung
 |line2=Disneyland Resort|right2=Disneyland Resort
 |line3=Airport Express|nonstop3=yes
 }}&lt;/nowiki&gt;
 |{{center|[[Module:Adjacent stations/MTR]]&lt;br/&gt;('''[[Sunny Bay station]]''')}}{{Adjacent stations
 |system=MTR
 |line1=Tung Chung|left1=Tsing Yi|right1=Tung Chung
 |line2=Disneyland Resort|right2=Disneyland Resort
 |line3=Airport Express|nonstop3=yes
 }}
 }}
 
 == See also ==
 * {{t|Sequence}} - a similarly formatted template for providing previous/next navigation to more general subjects
 
 &lt;includeonly&gt;{{Sandbox other||
 &lt;!-- Categories below this line, please; interwikis at Wikidata --&gt;
 [[Category:Rail transport succession templates]]