Documentation for this module may be created at Module:Noticebox/doc
local p = {}
function p._main(args)
local container = mw.html.create('table')
container
:addClass('noticebox ' .. (args.class or ''))
:css({
['width'] = '90%',
['background'] = args.bgcolor or '#333',
['border'] = '1px solid ' .. (args.bordercolor or '#555'),
['border-left-width'] = '10px',
['border-radius'] = '0.5em 0 0 0.5em',
['margin'] = '0 auto 10px'
})
local row = container:tag('tr')
if args.image and args.image ~= '' then
local imageWidth = args['image-width'] or args['image_width'] or '48px'
local imageClass = args['image-class'] or args['image_class'] or ''
row:tag('td')
:css({['width'] = '50px', ['padding'] = '0'})
:wikitext(string.format('[[File:%s|%s|center|class=notpageimage %s|link=]]',
args.image, imageWidth, imageClass))
end
row:tag('td')
:css({
['color'] = args.color or '#fff',
['vertical-align'] = 'middle',
['padding-left'] = '5px'
})
:wikitext(args.content or args[1] or 'Content here')
return tostring(container)
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame)
return p._main(args)
end
return p