Module:Sandbox/Pizza1016/Victoria infobox station name formatting/doc

This Lua module generates a HTML formatting string for the headers of Infobox station templates placed on Victorian passenger railway stations. This adds a coloured bar at the top of the infobox, in the style of the recently introduced wayfinding signage on station platforms, that indicates the lines that are served by the station.

This module obtains line colour data from and.

Usage
This module contains one function format that accepts an unlimited number of positional arguments as strings. Each argument is the name of a line.

For each line defined in either of the two aforementioned data modules, the script will generate the corresponding colour bar for each line, evenly spaced and in the order provided. Lines with the same line colours (i.e. from the same group of lines), as defined by the data modules, will only appear once, in the position of the first line with that colour.

Internally, this script creates multiple bars of different lengths that overlap each other, to give it the appearance of equally sized bars next to each other.

If a name that doesn't exist in either data module is provided, an error will be raised for each line that doesn't exist.

Place this in the parameter before the station name to generate the appropriate style.