Module:VersionInfobox: Difference between revisions
DrinkyBird (talk | contribs) (Created page with "local capiunto = require 'capiunto' local p = {} function p.main(frame) local args = frame:getParent().args local headerStyle if args.headerstyle and args.headerstyle ~=...") |
DrinkyBird (talk | contribs) No edit summary |
||
Line 15: | Line 15: | ||
headerStyle = headerStyle, | headerStyle = headerStyle, | ||
} ) | } ) | ||
:addRow( 'Release date', args.releasedate ) | |||
:addRow( 'ZDoom base', args.zdoomversion ) | if args.releasedate ~= nil then | ||
:addRow( 'GZDoom base', args.gzdoomversion ) | retval:addRow( 'Release date', args.releasedate ) | ||
:addRow( 'Links', args.links ) | end | ||
:addRow( 'Downloads', args.downloads ) | |||
if args.zdoomversion ~= nil then | |||
retval:addRow( 'ZDoom base', args.zdoomversion ) | |||
end | |||
if args.gzdoomversion ~= nil then | |||
retval:addRow( 'GZDoom base', args.gzdoomversion ) | |||
end | |||
if args.links ~= nil then | |||
retval:addRow( 'Links', args.links ) | |||
end | |||
if args.downloads ~= nil then | |||
retval:addRow( 'Downloads', args.downloads ) | |||
end | |||
return retval | return retval | ||
end | end | ||
return p | return p |
Revision as of 19:32, 26 October 2021
Documentation for this module may be created at Module:VersionInfobox/doc
local capiunto = require 'capiunto'
local p = {}
function p.main(frame)
local args = frame:getParent().args
local headerStyle
if args.headerstyle and args.headerstyle ~= '' then
headerStyle = string.format('background-color:%s;', args.headerstyle)
else
headerStyle = 'background-color:grey;'
end
local retval = capiunto.create( {
title = args.title,
headerStyle = headerStyle,
} )
if args.releasedate ~= nil then
retval:addRow( 'Release date', args.releasedate )
end
if args.zdoomversion ~= nil then
retval:addRow( 'ZDoom base', args.zdoomversion )
end
if args.gzdoomversion ~= nil then
retval:addRow( 'GZDoom base', args.gzdoomversion )
end
if args.links ~= nil then
retval:addRow( 'Links', args.links )
end
if args.downloads ~= nil then
retval:addRow( 'Downloads', args.downloads )
end
return retval
end
return p