Module:Hatnote: Difference between revisions

From 2006Scape Wiki
Jump to navigation Jump to search
scape_>Shayani
(module cause why not)
 
scape_>Shayani
(gone)
Line 15: Line 15:
end
end


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



Revision as of 08:21, 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)
	local hatnote = mw.html.create('div')

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

return p