local x = "%1 station"
local rs = "%1 railway station"
local default = "%1 tube station"
local Q_type = "<span class=\"error\">Specify a type</span>"  
local p = {
["system title"] = "London Underground",
["system icon"] = "",
["station format"] = {
default,  
-- Multi-line stations
["Bank"] = "Bank and Monument stations",
["Barking"] = x,
["Blackfriars"] = x,
["Bond Street"] = x,
["Cannon Street"] = x,
["Charing Cross"] = {
default,
["District"] = "Embankment tube station"
},
["Denham"] = rs,
["Edgware Road"] = {
"Edgware Road tube station (Circle, District and Hammersmith & City lines)",
["Bakerloo"] = "Edgware Road tube station (Bakerloo line)"
},
["Ealing Broadway"] = x,
["Farringdon"] = x,
["Finsbury Park"] = x,
["Hammersmith"] = {
"Hammersmith tube station (Circle and Hammersmith & City lines)",
["District"] = "Hammersmith tube station (District and Piccadilly lines)",
["Piccadilly"] = "Hammersmith tube station (District and Piccadilly lines)"
},
["Leigh-on-Sea"] = rs,
["Liverpool Street"] = x,
["London Bridge"] = x,
["Monument"] = "Bank and Monument stations",
["Moorgate"] = x,
["Paddington"] = {
"Paddington tube station (Bakerloo, Circle and District lines)",
["Hammersmith & City"] = "Paddington tube station (Circle and Hammersmith & City lines)",
["Circle"] = {
["section 1"] = "Paddington tube station (Circle and Hammersmith & City lines)",
["section 6"] = "Paddington tube station (Bakerloo, Circle and District lines)"
},
["Metropolitan Railway"] = "Paddington tube station (Circle and Hammersmith & City lines)",
["Great Western Railway"] = "Paddington tube station (Circle and Hammersmith & City lines)"
},
["Shepherd's Bush"] = {
default,
["Metropolitan"] = "Shepherd's Bush Market tube station",
["London and South Western Railway"] = "Shepherd's Bush railway station (1869–1916)"
},
["Shoeburyness"] = rs,
["Stratford"] = x,
["Southend Central"] = rs,
["Sutton"] = "Sutton railway station (London)",
["Sutton Common"] = rs,
["Swiss Cottage"] =
{
default,
["Metropolitan"] = "Swiss Cottage tube station (1868–1940)"
},
["Terminals 2 & 3"] = "Heathrow Terminals 2 & 3 tube station",
["Terminal 4"] = "Heathrow Terminal 4 tube station",
["Tottenham Court Road"] = x,
["West Ham"] = x,
["Wood Green"] = {
default,
["Great Northern & Strand"] = "Alexandra Palace railway station"
},
["Wood Lane"] = {
default,
["Central"] = "Wood Lane tube station (Central line)",
["Metropolitan"] = "Wood Lane tube station (Metropolitan line)"
},  
-- Bakerloo line
["Bushey"] = rs,
["Carpenders Park"] = rs,
["Harlesden"] = x,
["Harrow & Wealdstone"] = x,
["Hatch End"] = rs,
["Headstone Lane"] = rs,
["North Wembley"] = x,
["Old Oak Common"] = rs,
["Queen's Park"] = "Queen's Park station (England)",
["South Kenton"] = x,
["Stonebridge Park"] = x,
["Victoria"] = "London Victoria station",
["Wembley Central"] = x,
["Whitechapel"] = x,
["Willesden Junction"] = x,  
-- Central line
["Greenford"] = x,
["North Weald"] = rs,
["Ongar"] = rs,
["Post Office"] = "St Paul's tube station",
["South Ruislip"] = x,
["West Ruislip"] = x,  
-- Circle line  
-- District line
["Gunnersbury"] = x,
["Hanwell"] = rs,
["Heston & Hounslow"] = "Hounslow Central tube station",
["Hounslow Barracks"] = "Hounslow West tube station",
["Kew Gardens"] = "Kew Gardens station (London)",
["Langley"] = rs,
["Morden (Village)"] = "Morden",
["Richmond"] = "Richmond station (London)",
["Slough"] = rs,
["South Acton"] = "South Acton railway station (England)",
["Southall"] = rs,
["Upminster"] = x,
["West Brompton"] = x,
["West Drayton"] = rs,
["West Ealing"] = rs,
["Wimbledon"] = x,
["Windsor"] = "Windsor & Eton Central railway station",  
-- Hammersmith & City line  
-- Jubilee line
["Canada Water"] = x,
["Canning Town"] = x,
["Fenchurch Street"] = rs,
["Silvertown"] = rs,  
-- Metropolitan line
["Amersham"] = x,
["Aylesbury"] = rs,
["Brill"] = rs,
["Chalfont & Latimer"] = x,
["Chorleywood"] = x,
["Great Missenden"] = rs,
["Harrow-on-the-Hill"] = x,
["Kensington (Addison Road)"] = "Kensington (Olympia) station",
["Quainton Road"] = rs,
["Rickmansworth"] = x,
["Stoke Mandeville"] = rs,
["Verney Junction"] = rs,
["Watford High Street"] = rs,
["Watford Junction"] = rs,
["Wendover"] = rs,  
-- Northern line
["Alexandra Palace"] = "Alexandra Palace railway station (1873–1954)",
["Balham"] = x,
["Cranley Gardens"] = rs,
["Crouch End"] = rs,
["Essex Road"] = rs,
["Kentish Town"] = x,
["Mill Hill (The Hale)"] = rs,
["Muswell Hill"] = rs,
["Old Street"] = x,
["Stroud Green"] = rs,  
-- Piccadilly line
["Dover Street"] = "Green Park tube station",
["Heathrow Terminal 5"] = x,
--psudo station entry for display as terminal
["Heathrow"] = "Heathrow Airport (Terminal 4 or Terminal 5)",  
-- Victoria line
["Blackhorse Road"] = x,
["Highbury & Islington"] = x,
["Seven Sisters"] = x,
["Vauxhall"] = x,
["Tottenham Hale"] = x,
["Walthamstow Central"] = x,
["Walthamstow Wood Street"] = "Wood Street railway station",  
-- Waterloo & City line  
-- Historical lines
["Addison Road"] = "Kensington (Olympia) station",
["Custom House"] = x,
["Deptford Road"] = "Surrey Quays railway station",
["Drayton Park"] = rs,
["Gillespie Road"] = "Arsenal tube station",
["Hammersmith (Grove Road)"] = rs,
["Harringay"] = rs,
["Harrow"] = {
default,
["Metropolitan Railway"] = "Harrow-on-the-Hill station"
},
["Hornsey"] = rs,
["New Cross"] = rs,
["New Cross Gate"] = rs,
["Putney Bridge & Fulham"] = "Putney Bridge tube station",
["Rotherhithe"] = rs,
["Shadwell"] = rs,
["St Pancras"] = rs,
["Strand"] = "Aldwych tube station",
["Surrey Docks"] = "Surrey Quays railway station",
["Surrey Quays"] = rs,
["Wapping"] = rs,
["Woolwich Arsenal"] = x
},
["lines"] = {
["_default"] = {
["title"] = "%1 line",
["color"] = "10069f",
["text color"] = "ffffff"
},
["Bakerloo"] = {
["color"] = "a45a2a",
["icon"] = "",
[" terminus"] = "Harrow & Wealdstone",
[" terminus"] = "Elephant & Castle",
["types"] = {
["Stanmore"] = {
["title"] = "Stanmore branch (1939–1979)",
[" terminus"] = "Stanmore",
[" terminus"] = "Elephant & Castle"
}
}
},
["Central"] = {
["title"] = "Central line",
["color"] = "da291c",
["icon"] = "",
[" terminus"] = {"Ealing Broadway", "West Ruislip"},
[" terminus"] = {"Epping", "Hainault", "Woodford", ["via"] = "Newbury Park"},
["types"] = {
["Ealing Broadway"] = {
["title"] = "Ealing Broadway branch",
[" terminus"] = "Ealing Broadway"
},
["Ruislip"] = {
["title"] = "Ruislip Branch",
[" terminus"] = "West Ruislip"
}
}
},
["Circle"] = {
["title"] = "Circle line",
["color"] = "ffcd00",
["text color"] = "10069f",
["icon"] = "",
["circular"] = true, --for custom links to terminus
[" terminus"] = Q_type,
[" terminus"] = Q_type,
["types"] = {
["section 1"] = {
["title"] = "",
[" terminus"] = "Hammersmith",
[" terminus"] = {"Edgware Road", ["via"] = "Aldgate"}
},
["section 2"] = {
["title"] = "",
[" terminus"] = {"Hammersmith", ["via"] = "King's Cross St Pancras"},
[" terminus"] = {"Edgware Road", ["via"] = "Victoria"}
},
["section 3"] = {
["title"] = "",
[" terminus"] = {"Edgware Road", ["via"] = "Victoria"},
[" terminus"] = {"Hammersmith", ["via"] = "King's Cross St Pancras"}
},
["section 4"] = {
["title"] = "",
[" terminus"] = {"Edgware Road", ["via"] = "Victoria"},
[" terminus"] = {"Hammersmith", ["via"] = "Tower Hill"}
},
["section 5"] = {
["title"] = "",
[" terminus"] = "Edgware Road",
[" terminus"] = {"Hammersmith", ["via"] = "Tower Hill"}
},
["section 6"] = {
["title"] = "",
[" terminus"] = {"Hammersmith", ["via"] = "Tower Hill"},
[" terminus"] = "Edgware Road"
}
}
},
["Chelsea-Hackney"] = {
["color"] = "8cc63e",
["text color"] = "10069f"
},
["District"] = {
["color"] = "007a33",
["icon"] = "",
[" terminus"] = {"Wimbledon", "Richmond", "Ealing Broadway"},
[" terminus"] = {"Upminster", "High Street Kensington", "Edgware Road"},
["types"] = {
["Deep"] = { --Abandoned plan
["title"] = "Deep-level route\n(1898–1908)",
[" terminus"] = {"Wimbledon", "Richmond", "Ealing Broadway", "Hounslow West"},
[" terminus"] = "Mansion House"
},
["Ealing Broadway"] = {