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 additionalClass = args.class or '' local class = ('mw-collapsible mw-%s textsection %s'):format(		(collapsible == 'un' or collapsible == 'uncollapsed' or collapsible == 'notcollapsed') 		and 'uncollapsed' or 'collapsed',		additionalClass	) 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 args.text or 'Show/Hide' local additionalClass = args.class or '' local class = ('mw-customtoggle-%s wikia-menu-button hidden%s %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 '',		additionalClass	) local style = args.style or '' return string.wrapHtml(name, 'div', { class = class, style = style }) end

return p