Module:Hatnote

From 2006Scape Wiki
Revision as of 08:21, 13 May 2022 by scape_>Shayani (gone)
Jump to navigation Jump to search

Documentation for this module may be created at Module:Hatnote/doc

-- repurposed from                                                            --
-- https://en.wikipedia.org/w/index.php?title=Module:Hatnote&oldid=1063743122 --
--                                                                            --
-- Implements {{hatnote}} template                                            --

local p = {}

function p.hatnote(frame)
	local args = frame:getParent().args
	local s = args[1]
	if not s then
		return error('no text specified for hatnote')
	end
	return p._hatnote(s)
end

function p._hatnote(s)
	local hatnote = mw.html.create('div')

	hatnote
		:attr('role', 'note')
		:addClass('hatnote')
		:addClass('navigation-not-searchable')
		:wikitext(s)
	
	return tostring(hatnote)
end

return p