Module: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 9: | Line 9: | ||
:attr('role', 'note') |
:attr('role', 'note') |
||
-- set the color so the look stays consistent even outside of the scope |
|||
if args['color'] then |
if args['color'] then |
||
wrapper:css('--color-amaranth-legacy-scope', args['color']) |
wrapper:css('--color-amaranth-legacy-scope', args['color']) |
||
| Line 16: | Line 17: | ||
end |
end |
||
-- top <hr> |
|||
if not yesno(args['remove_hr']) and not yesno(args['remove_hr_top'] |
if not yesno(args['remove_hr'] or true) and not yesno(args['remove_hr_top'] or true) then |
||
wrapper:wikitext('<hr>') |
wrapper:wikitext('<hr>') |
||
end |
end |
||
| Line 22: | Line 24: | ||
wrapper:wikitext('ababa') |
wrapper:wikitext('ababa') |
||
-- bottom <hr> |
|||
if not yesno(args['remove_hr']) and not yesno(args['remove_hr_bottom'] |
if not yesno(args['remove_hr'] or true) and not yesno(args['remove_hr_bottom'] or true) then |
||
wrapper:wikitext('<hr>') |
wrapper:wikitext('<hr>') |
||
end |
end |
||
Revision as of 18:10, January 13, 2025
This module is used for Template:Hatnote. See the template's page for more information.
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local p = {}
function p.main(frame)
local args = getArgs(frame)
local wrapper = mw.html.create('div')
:attr('class', 'noexcerpt')
:attr('role', 'note')
-- set the color so the look stays consistent even outside of the scope
if args['color'] then
wrapper:css('--color-amaranth-legacy-scope', args['color'])
if yesno(args['color_applies_to_links']) or true then
wrapper:css('--color-link', args['color'])
end
end
-- top <hr>
if not yesno(args['remove_hr'] or true) and not yesno(args['remove_hr_top'] or true) then
wrapper:wikitext('<hr>')
end
wrapper:wikitext('ababa')
-- bottom <hr>
if not yesno(args['remove_hr'] or true) and not yesno(args['remove_hr_bottom'] or true) then
wrapper:wikitext('<hr>')
end
return tostring(wrapper)
end
return p