Module:Element

--	A module for general wikitext elements. --

local getArgs = require('Module:Arguments').getArgs local string = require('Module:String') local table = require('Module:Table') local yesno = require('Module:Yesno')

local p = {} local replpttn = '[%s\'",;:\.]'

function p.collapsible( frame ) local args = getArgs(frame) local collapsible = args.collapsible and args.collapsible:lower or 'collapsed' local class = ('mw-collapsible mw-%s'):format(		(collapsible=='un' or collapsible=='uncollapsed' or collapsible=='notcollapsed') 		and 'uncollapsed' or 'collapsed'	) local id = ('mw-customcollapsible-%s'):format(		args.id and args.id:lower:gsub(replpttn,'-') or 			mw.title.getCurrentTitle.fullText:lower:gsub(replpttn,'-')	) return string.wrapHtml(args[1] or '', 'div', { class = class, id = id }) end

function p.collapsibleButton( frame ) local args = getArgs(frame) local name = args[1] or args.name or 'Show/Hide' local class = ('mw-customtoggle-%s wikia-menu-button hidden%s'):format(		args.id and args.id:lower:gsub(replpttn,'-') or 			mw.title.getCurrentTitle.fullText:lower:gsub(replpttn,'-'),		yesno(args.small, false) and ' small' or ''	) local style = ('padding:3px 5px;%s'):format(		args.style or ''	) return string.wrapHtml(name, 'div', { class = class, style = style }) end

return p