Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a220259f6e47227c

Jump to content

Module:Sandbox/Nihiltres/Testing

From Wikipedia, the free encyclopedia
p = {}

function p.main (frame)
	local foo = 'Result of tested Lua snippet would be here.'
	
	local bar = mw.loadData('Module:Class/importDefinitions')
	local foo = mw.html.create("td")
	local dtc = "unassessed" --default test class
	local class = bar[frame.args[1] or dtc] or bar[dtc]
	local styleBasics = "text-align: center; font-weight: bold; "
	foo:attr(
		"style",
		styleBasics .. string.format("background-color: %s;", class.colour)
	)
	local img = class.icon.default and string.format(
			"[[File:%s|16px|%s|link=|alt=]] ",
			class.icon.file,
			class.labels.full
		) or ""
	local link = string.format(
		"[[:%s|%s]]",
		class.category,
		class.labels.short
	)
	foo:wikitext(img, link)
	return foo
	--return mw.dumpObject(foo)
end

return p