Module:Scope hatnote: Difference between revisions
From Amaranth Legacy, available at amaranth-legacy.community
More actions
Content deleted Content added
Tesinormed (talk | contribs) No edit summary |
Tesinormed (talk | contribs) No edit summary |
||
| Line 7: | Line 7: | ||
-- input validation |
-- input validation |
||
if not args['scope'] then error('"scope" argument is required') end |
if not args['scope'] then error('"scope" argument is required') end |
||
if not args['rawcss_ref'] then error('"scope" argument is required') end |
|||
local result = '' |
local result = '' |
||
| Line 13: | Line 14: | ||
if yesno(args['remove_parentheses'] or true) then |
if yesno(args['remove_parentheses'] or true) then |
||
result = result .. require('Module:Remove parentheses').main(frame) |
result = result .. require('Module:Remove parentheses').main(frame) |
||
end |
|||
if yesno(args['use_scope_styling'] or true) then |
|||
result = result .. frame:extensionTag('rawcss', '', { |
|||
ref = args['rawcss_ref'] |
|||
}) |
|||
end |
end |
||
Revision as of 16:57, February 20, 2025
General template for scope hatnote templates
Parameters
for- Used in the description of the TemplateData
rawcss_ref- RawCSS application reference to use
categories- Categories to use (like
Category:Scope: Imagindarium's Creation) use_remove_parentheses- If Module:Remove parentheses should be used
use_hatnote_links- If Template:Hatnote links should be used
local yesno = require('Module:Yesno')
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
if not args['rawcss_ref'] then error('"scope" argument is required') end
local result = ''
-- [[Module:Remove parentheses]]
if yesno(args['remove_parentheses'] or true) then
result = result .. require('Module:Remove parentheses').main(frame)
end
if yesno(args['use_scope_styling'] or true) then
result = result .. frame:extensionTag('rawcss', '', {
ref = args['rawcss_ref']
})
end
return result
end
return p