Module:ScopeBox: Difference between revisions
From Amaranth Legacy, available at amaranth-legacy.community
More actions
Content deleted Content added
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..." |
Tesinormed (talk | contribs) No edit summary |
||
| Line 15: | Line 15: | ||
:addClass('template-ScopeBox-content') |
:addClass('template-ScopeBox-content') |
||
:tag('div') |
:tag('div') |
||
:wikitext('[[File:' .. (args['left_symbol'] or args['symbol']) .. '|80px|link=|alt=]]') |
|||
:done() |
:done() |
||
:tag('div') |
:tag('div') |
||
:wikitext('[[Scope:' .. args['scope'] .. '|' .. args['scope'] .. ']]') |
|||
:done() |
:done() |
||
:tag('div') |
:tag('div') |
||
:wikitext('[[File:' .. (args['right_symbol'] or args['symbol']) .. '|80px|link=|alt=]]') |
|||
:done() |
:done() |
||
:done() |
:done() |
||
Revision as of 06:51, February 4, 2025
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')
:wikitext('[[File:' .. (args['left_symbol'] or args['symbol']) .. '|80px|link=|alt=]]')
:done()
:tag('div')
:wikitext('[[Scope:' .. args['scope'] .. '|' .. args['scope'] .. ']]')
:done()
:tag('div')
:wikitext('[[File:' .. (args['right_symbol'] or args['symbol']) .. '|80px|link=|alt=]]')
: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