Module:Sandbox/3df/grapheme

local p = {}

local abcd = { basiclatin = { alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', articles = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'		} } }

local function alphaNav(frame, series) local out = {width = 'abcd'} for i = 1, #series.alphabet do table.insert(out,  .. series.alphabet:sub(i, i) .. series.alphabet:sub(i, i):lower .. ) end return frame:expandTemplate({title = 'grid list', args = out}) end

p.main = function(frame) local pargs = frame:getParent.args local ibArgs = {title = 'A'} local series = 'basiclatin' local alphabet = '' ibArgs.headerstyle = 'background: lightblue;' ibArgs.label10 = 'Phonetic usage' ibArgs.data10 = '' if series == 'basiclatin' then ibArgs.image = '' ibArgs.imagestyle = 'padding-bottom: 12px; height: 48px;' ibArgs.header1 = 'Basic Latin script letter' ibArgs.label3 = 'Name in English' ibArgs.data3 = '' ibArgs.label51 = 'NATO phonetic' ibArgs.data51 = 'Alfa' local morseArgs = {'A' .. ' morse code.ogg', frame:expandTemplate({title = 'morse', args = {'dot', 'dash'}})} ibArgs.label52 = 'Morse code' ibArgs.data52 = frame:expandTemplate({title = 'audio', args = morseArgs}) ibArgs.header50 = 'Other representations' local otherReps = ' ' ibArgs.data56 = otherReps end if series then ibArgs.above = '' ibArgs.data2 = alphaNav(frame, abcd[series]) ibArgs.label11 = 'Position' ibArgs.data11 = '' end

local root = mw.html.create('div'):wikitext(frame:expandTemplate({title = 'infobox', args = ibArgs}))

return tostring(root) end return p