Template:Adjacent stations/doc

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).

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 S-line, you can also use 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
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.,  ). Parameters without a number suffix are treated as group 1.

Conversion from S-line
After creating the module subpage, you can use the  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:

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.