Changes
Add size arg to format_image()
local BaseData = {
local BaseData = {
_image_template = "[[File:%s]]",
_image_template = "[[File:%s]]",
_image_sized_template = "[[File:%s|%s]]",
_no_image = "Catbomb.png|300px",
_no_image = "Catbomb.png|300px",
_no_image_size = "300px",
_simple_link = "[[%s]]",
_simple_link = "[[%s]]",
_aliased_link = "[[%s|%s]]",
_aliased_link = "[[%s|%s]]",
})
})
function BaseData:format_image(name, raw)
function BaseData:format_image(name, size, raw)
if raw then
if raw then
return name
return name
elseif name == nil then
elseif name == nil then
return mw.ustring.format(self._image_template, self._no_image)
return mw.ustring.format(self._image_sized_template, self._no_image, self._no_image_size)
else
else
return mw.ustring.format(self._image_template, name)
if size then
return mw.ustring.format(self._image_sized_template, name, size)
else
return mw.ustring.format(self._image_template, name)
end
end
end
end
end