Module:Hatnote: Difference between revisions

From 2006Scape Wiki
Jump to navigation Jump to search
scape_>Shayani
(module cause why not)
(No difference)

Revision as of 08:04, 13 May 2022

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, options)
	local hatnote = mw.html.create('div')

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

return p