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:Sandbox/DePiep/iso

From Wikipedia, the free encyclopedia
local p = {}
local getArgs = require('Module:Arguments').getArgs

local t1 = {}
local t2 = {}

local function printTable( t )
	local s = ''
	for k, v in pairs( t ) do
    	s = s .. k ..'=' .. tostring( v ) .. ', '
	end
	return s .. '.'
end

function p.isotopeRow( frame )
	local args = getArgs( frame )
	t1['id'] = args['sym'] .. '-' .. args['mn']
	t1['hl'] = args['hl']
	t1['na'] = args['na']
	t1['n'] = args['n']
	t1['mn'] = args['mn']
	t1['sym'] = args['sym']

	local dmPattern = '^dm%d?$'
	local dePattern = '^de%d?[ab]?$' -- 3 (2 2 1)
	local i = 0
	local j = 0
	for k, v in pairs( args ) do
		if mw.ustring.find(tostring(k), dmPattern) then
			i = i + 1
		end
		if mw.ustring.find(tostring(k), dePattern) then
			j = j + 1
		end
	end
	t1['decayCount'] = math.max( i, j )
	return "* Hello row " .. t1['id'] .. ': <br/>' .. printTable( t1 )
end

return p