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 |
||
(5 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
function p.main(frame) | function p.main(frame) | ||
local args = frame:getParent().args | local args = frame:getParent().args | ||
local headerStyle | local headerStyle | ||
if args.headerstyle | if args.headerstyle == 'zandronum' then | ||
headerStyle = | headerStyle = 'background-color: #35b06c;' | ||
else | else | ||
headerStyle = 'background-color:grey;' | headerStyle = 'background-color: grey;' | ||
end | end | ||
local retval = capiunto.create( { | local retval = capiunto.create( { | ||
title = args.title, | title = args.title, | ||
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( ' | end | ||
:addRow( ' | |||
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.hgtag ~= nil then | |||
retval:addRow( 'Mercurial tag', string.format( '[https://osdn.net/projects/zandronum/scm/hg/zandronum-stable/commits/%s %s]', args.hgtag, args.hgtag) ) | |||
end | |||
if args.previousversion ~= nil then | |||
retval:addRow( 'Previous', args.previousversion ) | |||
end | |||
if args.nextversion ~= nil then | |||
retval:addRow( 'Next', args.nextversion ) | |||
end | |||
return retval | return retval | ||
end | end | ||
return p | return p |
Latest revision as of 19:47, 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 == 'zandronum' then
headerStyle = 'background-color: #35b06c;'
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.hgtag ~= nil then
retval:addRow( 'Mercurial tag', string.format( '[https://osdn.net/projects/zandronum/scm/hg/zandronum-stable/commits/%s %s]', args.hgtag, args.hgtag) )
end
if args.previousversion ~= nil then
retval:addRow( 'Previous', args.previousversion )
end
if args.nextversion ~= nil then
retval:addRow( 'Next', args.nextversion )
end
return retval
end
return p