Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
You must create an account or log in to edit.
Revision as of 06:46, February 4, 2025 by Tesinormed (talk | contribs) (Created page with "local libraryUtil = require('libraryUtil') local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg local p = {} function p.main(frame) local args = require('Module:Arguments').getArgs(frame) -- input validation if not args['scope'] then error('"scope" argument is required') end local output = mw.html.create('div') :addClass('template-ScopeBox') :addClass('template-ScopeBox--' .. args['scope']) :tag('div') :addClass('template-ScopeBox-content') :t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This module is used for Template:ScopeBox. See the template's page for more information.


local libraryUtil = require('libraryUtil')
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg

local p = {}

function p.main(frame)
	local args = require('Module:Arguments').getArgs(frame)
	-- input validation
	if not args['scope'] then error('"scope" argument is required') end

	local output = mw.html.create('div')
		:addClass('template-ScopeBox')
		:addClass('template-ScopeBox--' .. args['scope'])
		:tag('div')
			:addClass('template-ScopeBox-content')
			:tag('div')
			:done()
			:tag('div')
			:done()
			:tag('div')
			:done()
		:done()

	return frame:extensionTag { name = 'templatestyles', args = { src = 'Module:ScopeBox/styles.css' } }
		.. frame:extensionTag { name = 'templatestyles', args = { src = 'Module:ScopeBox/styles-' .. args['scope'] .. '.css' } }
		.. tostring(output)
end

return p