Content deleted Content added
Enabled single transclusion. |
|||
Line 1:
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
local yesno = require("Module:Yesno")
local _style = {
['3'] = 'style="width: 30%;',
Line 75 ⟶ 79:
function p.top()
return table.concat({'{| class="wikitable" ', style['table']})
function p.rail(data)
})
end
Line 89 ⟶ 101:
for i = 1, #args.line do
local _line = data
lineTitle[i] = _line['line title']
Line 135 ⟶ 147:
end
end
▲ header = table.concat({'\n|-',
▲ '\n!', style['header leftcell'], 'Preceding station',
▲ '\n!', style['header midcell'], data[i]['system title'],
▲ '\n!', style['header rightcell'], 'Following station'})
▲ table.insert(t, table.concat({header,
'\n|', style['body leftcell'], left[i], leftTerminus[i],
'\n|', style['body banner'], colour[i], '"| ',
Line 164 ⟶ 165:
function p.main(frame)
local args = {
['system'] =
['line'] = {},
['left'] = {},
Line 177 ⟶ 178:
['circularR'] = {}
}
local data = require('Module:L-rail/' .. args.system)
for k, v in pairs(frame:getParent().args) do
local a = string.match(k, '(%a+)%d+')
if not a then
Line 188 ⟶ 190:
end
if a == '
args.line[b] = v
elseif a == 'left' then
Line 219:
end
local _rows = frame:getParent().args.rows or 'all'
local
['all'] = table.concat({p.top(), p.rail(data), p.line(data, args), p.bottom()}),▼
['bottom'] = table.concat({p.rail(data), p.line(data, args), p.bottom()})▼
▲ end
▲ ['all'] = table.concat({p.top(), p.line(data, args), p.bottom()}),
▲ ['top'] = table.concat({p.top(), p.line(data, args)}),
▲ ['bottom'] = table.concat({p.line(data, args), p.bottom()})
}
▲ return rows['all']
end
|