Module:Adjacent stations/sandbox: Difference between revisions

Content deleted Content added
Temporary testing. Reverting later.
Undid revision 838656922 by Szqecs (talk)
Line 88:
local t = {}
for i, v in ipairs(index) do
function mapArg(i, v)
if args.system[v] then
table.insert(t, table.concat({'\n|-',
Line 104:
local _line = data[v][args.line[v]]
lineTitle[v] = _line['line title']
colour[v] = _line.colour or _line.color
note[v] = args.note[v] or ''
Line 170:
table.insert(t, table.concat({'\n|', style['body rightcell'], right[v], rightTerminus[v]}))
end
end
for i, v in ipairs(index) do
mapArg(i, v)
end
Line 219 ⟶ 216:
-- to do: add rest of S-line parameters
local _index = {}
local functionparameters mapArg(key,= value){
local parameters['strings'] = {
['stringssystem'] = {'system',
['systemline'] = 'systemline',
['lineleft'] = 'lineleft',
['leftright'] = 'leftright',
},
['right'] = 'right'
['optional strings'] = {
},
['optional stringsnote'] = {'note',
['notetype'] = 'noteType',
['type-left'] = 'TypeTypeL',
['type-leftright'] = 'TypeLTypeR',
-- ['through'] = 'through', -- The way this would work is that it would replace either "Terminus" cell, rather than just one of them in particular.
['type-right'] = 'TypeR',
-- ['through-rightleft'] = 'throughRthroughL',
-- ['through'] = 'through', -- The way this would work is that it would replace either "Terminus" cell, rather than just one of them in particular.
-- ['through-leftright'] = 'throughLthroughR',
-- ['through-rightbranch'] = 'throughRbranch',
-- ['branchtransfer'] = 'branchtransfer',
},
-- ['transfer'] = 'transfer'
['optional boolean'] = {
},
['optional booleanoneway-left'] = {'onewayL',
['oneway-leftright'] = 'onewayLonewayR',
-- ['onewayround-rightleft'] = 'onewayRroundL',
-- ['round-leftright'] = 'roundLroundR',
-- ['round-rightcircular'] = 'roundRcircular',
['circular-left'] = 'circularcircularL',
['circular-leftright'] = 'circularLcircularR',
['circularthrough-rightleft'] = 'circularRthroughL',
['through-leftright'] = 'throughLthroughR',
['through-right'] = 'throughR'
}
}
}
local a = string.match(key, '(%a+)%d+') or key
for k, v in pairs(_args) do
local b = tonumber(string.match(key, '%a+(%d+)')) or 1
local a = string.match(keyk, '(%a+)%d+') or keyk
local b = tonumber(string.match(keyk, '%a+(%d+)')) or 1
if parameters['strings'][a] then
args[parameters['strings'][a]][b] = valuev
_index[b] = true
elseif args[parameters['optional strings'][a]] then
args[parameters['optional strings'][a]][b] = valuev
elseif args[parameters['optional boolean'][a]] then
args[parameters['optional boolean'][a]][b] = yesno(valuev)
end
end
for k, v in pairs(_args) do
mapArg(k, v)
end
 
local index = {}
for k, v in pairs(_index) do
local function buildIndex(k)
table.insert(index, k)
end
for k, v in pairs(_index) do
buildIndex(k)
end
table.sort(index)
local data = {}
for i, v in ipairs(index) do
local function getData(i, v)
if args.system[v] then
-- data[v] = require('Module:L-rail/' .. args.system[v])
Line 284 ⟶ 275:
end
end
for i, v in ipairs(index) do
getData(i, v)
end
local rows = { -- Included for mixed used with S-line.