Module:History
Jump to navigation
Jump to search
Documentation for this module may be created at Module:History/doc
local p = {}
function p.main(frame)
local args = require("Dev:Arguments").getArgs(frame)
local result = {}
local update
local s, e, text
if args['collapsed'] and (args['collapsed'] == 'yes') then
table.insert(result, '{| class="mw-collapsible mw-collapsed" style="width: auto; display: grid; margin-bottom: 1em;" data-expandtext="Show History" data-collapsetext="Hide list" \n|+ \n|' )
end
table.insert(result, '<ul>')
for i,v in ipairs(args) do
update = string.match(v, '[0-9%.]+')
s, e = string.find(v, update, 1, plain)
update = '[[Version ' .. update .. '|' .. update .. ']]'
text = string.sub(v, 1, s-1) .. update .. string.sub(v, e+1)
table.insert(result, '<li>' .. text .. '</li>')
end
table.insert(result, '</ul>')
if args['collapsed'] and (args['collapsed'] == 'yes') then
table.insert(result, '|}')
end
return table.concat(result, '\n')
end
return p