Module:TabsBuilder

local TabsBuilder = {} TabsBuilder.__index = TabsBuilder TabsBuilder.__tostring = TabsBuilder.tostring

function TabsBuilder.new local obj = setmetatable({		tabs = mw.html.create('div'):addClass('tabs'),	}, TabsBuilder)

return obj end

function TabsBuilder:css(css) if css then self.tabs:css(css) end return self end

function TabsBuilder:addTab(page, text, options) self.tabs:wikitext(string.format( '%s', page, text or page ))

return self end

function TabsBuilder:addSpacer self.tabs:wikitext(' ') return self end

function TabsBuilder:tostring return mw.getCurrentFrame:extensionTag{ name = 'templatestyles', args = { src = 'Template:Tabs/styles.css' } } ..		tostring(self.tabs) end

return TabsBuilder