Module:Stub

local Stub = {} local getArgs = require('Dev:Arguments').getArgs

function Stub.main(frame) local args = getArgs(frame) return Stub._main(args) end

function Stub._main(args) local container = mw.html.create('div') :attr('id', 'mntExpand') :addClass('stub') local image = container:tag('span') :addClass('image') :css('text-align', 'center') :wikitext(args['image'] or '') local seguetext1 = '' local seguetext2 = '' local topicparam = args['topic'] local releaseparam = args['title'] or args[1] if topicparam and releaseparam then seguetext2 = ' in ' end if topicparam or releaseparam then seguetext1 = ' about ' end if not topicparam then topicparam = '' end if not releaseparam then releaseparam = '' end local beginningtext = 'This article or section is a stub' local extratext = seguetext1 .. topicparam .. seguetext2 .. releaseparam local closingtext = 'You can help the '..mw.site.siteName..' by ['..tostring(mw.uri.fullUrl(mw.title.getCurrentTitle.prefixedText,'action=edit'))..' expanding it]' local text = container:tag('span') :addClass('text') :css('left', '-40px') :css('padding-left', '40px') :wikitext(beginningtext .. extratext .. '. ' .. closingtext .. '.') local cat1 = '[' .. '[' .. 'Category:Stubs' .. ']' .. ']'   local cat2 = '' if releaseparam ~= '' then cat2 = '[' .. '[' .. 'Category:' .. releaseparam .. ' stubs' .. ']' .. ']'   end local categories = container:wikitext(cat1 .. cat2) return container end

return Stub