Wiki - KEONHACAI COPA

Bản mẫu:Trạm liền kề

Tài liệu bản mẫu[xem] [sửa] [lịch sử] [làm mới]

Adjacent stations is a specialised 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 {{S-line}} (see differences).

Cách sử dụng[sửa mã nguồn]

Data module[sửa mã nguồn]

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 {{S-line}}, you can also use {{Adjacent stations/row|system|line}} inside Special:ExpandTemplates to simplify subpage creation for lines with two termini. You will need to replace every two spaces with a tab space afterwards.

Transclusion[sửa mã nguồn]

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. system2, line2). Parameters without a number suffix are treated as group 1.

Parameters[sửa mã nguồn]

ParameterDescriptionBehaviour if absentNotes
systemnThe system to which line n belongs. This should correspond to a subpage of Module:Adjacent stations.
  • System for n assumed to be same as the previous group.
  • Renders empty table if no systems are entered.
Displays error message if unrecognised.
linenThe name of line n (or recognised alias). This should correspond to a key under ["lines"] 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 n assumed to be same as the previous group.
  • Renders only header row if no lines are entered.
Displays error message if unrecognised.
leftnThe 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.
rightnThe 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-leftnThe 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-rightnThe 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.
tonTerminus 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.
transfernThe name of the transfer station for the line, at stations where an interchange with a line at another nearby station is possible.
oneway-leftnIf 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-rightnIf 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.
nonstopnIf entered, instead of displaying previous and next stations, displays 'line does not stop here'. If the value for this parameter is 'former', then 'did not stop here' will be used instead.
headernA 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.
note-rownA 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-leftnA note, displayed below the left (previous) station's name.
note-midnA note, displayed below the line name in italics.
note-rightnA note, displayed below the right (next) station's name.
throughnThe through line – trains on the line run through to this line. If this is entered, 'through to line', in italics, displays where 'Terminus' would.
through-leftnThe through line for the left cell only (primarily for compatibility purposes).
through-rightnThe through line for the right cell only (primarily for compatibility purposes).
reversenIf this is entered, 'reverses direction', in italics, displays where 'Terminus' would.
reverse-leftnThe same for the left cell only (primarily for compatibility purposes).
reverse-rightnThe same for the right cell only (primarily for compatibility purposes).

Conversion from S-line[sửa mã nguồn]

After creating the module subpage, you can use the convert function of Module:Adjacent stations to replace transclusions of the S-line series templates (this currently does not work with {{Rail line}}-series templates). This can be semi-automated using regular expressions in AWB and other tools:

FindReplaceNotes
\|\s*system\s*=\s*oldSystem|system=newSystemReplacement for system name in {{S-line}}, if the old system is different from the new system. (Not necessary for {{S-rail}}, which is ignored.) Use the g regular expression flag to replace multiple uses.
(\| *(?:services|other_services) *=)((?:\s*\{\{.+\}\})+)$1 {{subst:#invoke:Adjacent stations|convert|$2}}Replacement for {{Infobox station}}'s |services= and |other_services= parameters.
(\{\{[Ss](?:(?:-rail)?-s)?tart\}\}(?:\s*\{\{.+\}\})+\s*\{\{(?:[Ss]-end|[Ee]nd)\}\}){{subst:#invoke:Adjacent stations|convert|$1}}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.

Ví dụ[sửa mã nguồn]

Cú phápKết quả
{{Adjacent stations 
|system=MTR |line=Island 
|left=Admiralty |right=Causeway Bay
}}
Ga trướcMTR MTRGa sau
Admiralty
hướng đi Kennedy Town
Tuyến đảoCauseway Bay
hướng đi Chai Wan
{{Adjacent stations 
|system=MTR
|line1=Tung Chung |left1=Tsing Yi |right1=Tung Chung
|line2=Disneyland Resort |right2=Disneyland Resort
|line3=Airport Express |nonstop3=yes
}}
Ga trướcMTR MTRGa sau
Tsing Yi
hướng đi Hong Kong
Tuyến Đông DũngTung Chung
hướng đi Đông Dũng
Ga cuốiTuyến Disneyland ResortDisneyland Resort
Ga cuối
     Sân bay tốc hành does not stop here
{{Adjacent stations
|system3=Taiwan High Speed Rail
|left3=Nam Cảng |right3=Bản Kiều
|system4=Taiwan Railways Administration
|line4=West Coast |left4=Tùng Sơn |right4=Vạn Hoa
}}
{{Adjacent stations 
|system=Taipei Metro |line=G 
|left=Cổ Đình |right=Công Quán |to-right=Tân Điếm
}}
Wiki - Keonhacai copa chuyên cung cấp kiến thức thể thao, keonhacai tỷ lệ kèo, bóng đá, khoa học, kiến thức hằng ngày được chúng tôi cập nhật mỗi ngày mà bạn có thể tìm kiếm tại đây có nguồn bài viết: https://vi.wikipedia.org/wiki/B%E1%BA%A3n_m%E1%BA%ABu:Tr%E1%BA%A1m_li%E1%BB%81n_k%E1%BB%81