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.

Jump to content

Module:Bka/sandbox

From Wikipedia, the free encyclopedia
local p = {}

local list = mw.loadData('Module:Bka/list')
local getArgs -- lazy load
local flagg -- lazy load

local notblank = function(v) return (v or '') ~= '' end
local ifblank = function(a, b) return notblank(a) and a or b end

function p._core(options, args, frame)
	flagg = flagg or require('Module:Flagg').luaMain
	frame = frame or mw.getCurrentFrame()
	local alias = flagg(frame, {'xxue', args[1]})
	local name = ifblank(args.name, alias)
	local link = list[alias] or alias
	return flagg(frame, {
		[1] = options,
		[2] = args[1],
		variant = ifblank(args.variant, args[2]),
		size = args.size,
		altvar = 'basketball',
		link = link,
		name = (name == 'full') and link or name
	})
end

function p.icon(frame)
	getArgs = getArgs or require('Module:Arguments').getArgs
	return p._core('cxxlo', getArgs(frame), frame)
end

function p.main(frame)
	getArgs = getArgs or require('Module:Arguments').getArgs
	return p._core('unc', getArgs(frame), frame)
end
p[''] = p.main

function p._list(item)
	return list[item] or ''
end
function p.list(frame)
	getArgs = getArgs or require('Module:Arguments').getArgs
	return p._list(getArgs(frame)[1])
end

return p